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德郁闷了,实在找不到什么好的数据了~~~~~~~~~#include"stdio.h" #include"math.h" int main() { __int64 n; while(scanf("%I64d",&n)==1 && n) { if(n==1) { printf("1\n"); continue; } __int64 m,i; int f=1; if(n<0) { f=0; n*=-1; } for(i=32;i>=1;i--) { m=(__int64)pow(n,1.0/i); if(n==(__int64)pow(m,i)) break; } if(f==0) { while(i%2==0) i/=2; printf("%d\n",i); } else printf("%d\n",i); } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator