Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:WA的不行了……坚持、、、哪位大侠帮个忙啊In Reply To:WA的不行了……坚持、、、哪位大侠帮个忙啊 Posted by:shiming413 at 2005-10-27 13:56:01 #include<math.h> #include <iostream.h> int main() { double a,b,c,d; int i,f; cin>>a; while(a) { if(a==1) { cout<<1<<endl; cin>>a; continue; } if(a<0) { f=1; a*=-1; } else f=0; i=32; while(a!=pow(int(pow(a,1.0/i)+0.5),i)&&i>1)///这里改改,呵呵 { //d=(pow(a,1.0/i)); //c=pow(int(pow(a,1.0/i)),i); i--; } if(f) while(i%2==0) i/=2; cout<<i<<endl; cin>>a; } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator