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

What's wrong?

Posted by songuno1 at 2006-01-28 02:31:20 on Problem 1730
#include <stdio.h>
#include <math.h>

double a;
unsigned int N;

int main (){
	short i;
	
	while ( scanf ( "%d", &N ) ){
		if (!N) break;
		
		for (i=31, a=0; i>=1; i--){
			a=pow ( N, (double)1/i );
			if ((int)a && fabs ( a-(int)a )<=0.0000001) break;
		}
		printf ( "%d\n", i );
	}
	
	return 0;
}


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