| ||||||||||
| 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 | |||||||||
WA N次了,郁闷至极,大家帮我看看哪里错了吧,谢谢各位了#include"stdio.h"
#include"math.h"
main(){
__int64 a,b;
double i,j,f,m;
while(scanf("%I64d",&a)){
b=fabs(a);
if(!a) break;
else if(b==4294967296)printf("32\n");
else if(b==2147483648&&a<0)printf("1\n");
else if(b==2147483648&&a>0)printf("31\n");
else{
a>0?m=1:m=2;
for(i=33;i>=1;i=i-m){
f=pow(b,1.0/i);
if(fabs(f-floor(f))<1e-20||fabs(f-ceil(f))<1e-20){
printf("%0.0f\n",i);
break;
}
}
}
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator