#include<iostream>
using namespace std;
int main()
{
int a,b,c;
while(cin>>a)
{
b=2;
int d=1;
while(a!=1)
{
c=0;
while(a%b==0)
{
a=a/b;
c=+1;
}
if(c>0&&d==1)
{
if ( c > 1 )
cout <<b<< "^" << c ;
if ( c== 1 )
cout <<b;
d++;
}
else if(c>0)
{
if ( c > 1 )
cout << " * "<<b<< "^" << c ;
if ( c== 1 )
cout << " * " <<b;
}
b++;
}
cout<<endl;
}
}
以上!
#include
using namespace std;
int main()
{
int a,b,c;
while(cin>>a)
{
b=2;
int d=1;
while(a!=1)
{
c=0;
while(a%b==0)
{
a=a/b;
c=+1;
}
if(c>0&&d==1)
{
if ( c > 1 )
cout <<b<< "^" << c ;
if ( c== 1 )
cout <<b;
d++;
}
else if(c>0)
{
if ( c > 1 )
cout << " * "<<b<< "^" << c ;
if ( c== 1 )
cout << " * " <<b;
}
b++;
}
cout<<endl;
}
}
以上!
你是怎樣!!!
看不懂字喔
為什麼要像個OO一樣
一直做不該做的事
#include
using namespace std;
int main()
{
int a,b,c;
while(cin>>a)
{
b=2;
int d=1;
while(a!=1)
{
c=0;
while(a%b==0)
{
a=a/b;
c=+1;
}
if(c>0&&d==1)
{
if ( c > 1 )
cout <<b<< "^" << c ;
if ( c== 1 )
cout <<b;
d++;
}
else if(c>0)
{
if ( c > 1 )
cout << " * "<<b<< "^" << c ;
if ( c== 1 )
cout << " * " <<b;
}
b++;
}
cout<<endl;
}
}
以上!
請問一下
你這程式和這個有差嗎?
https://zerojudge.tw/ShowThread?postid=19193&reply=19029#19193
連寫這種都要用抄的....
我想問問你
你自己寫出了幾題
2分鐘內寫出a982
這種實力我甘拜下風
明天有比賽
我期待你的表現
#include
using namespace std;
int main()
{
int a,b,c;
while(cin>>a)
{
b=2;
int d=1;
while(a!=1)
{
c=0;
while(a%b==0)
{
a=a/b;
c=+1;
}
if(c>0&&d==1)
{
if ( c > 1 )
cout <<b<< "^" << c ;
if ( c== 1 )
cout <<b;
d++;
}
else if(c>0)
{
if ( c > 1 )
cout << " * "<<b<< "^" << c ;
if ( c== 1 )
cout << " * " <<b;
}
b++;
}
cout<<endl;
}
}
以上!
你的程式(姑且不論是不是你寫的)有問題!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!