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

Re:WA的不行了……坚持、、、哪位大侠帮个忙啊

Posted by scauben0 at 2006-01-22 23:44:23 on Problem 1730
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:
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