Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

WA N次了,郁闷至极,大家帮我看看哪里错了吧,谢谢各位了

Posted by clwey at 2006-04-03 13:01:24 on Problem 1730
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator