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

help me !

Posted by migarow at 2006-09-13 19:16:22 on Problem 1730
#include <stdio.h>
#include <cmath>
#include <cstdlib>
#include <iostream>
using namespace std;
double a;
int N;
int main (){
	short i;
	bool b=true;
	while ( scanf ( "%d", &N ) ){
		if (!N) break;
		b=true;
		if(N==1){printf("%d\n",1);b=false;}
		if(b){
		for (i=50, a=0; i>=1; i--){
			a=pow ( N, (double)1/i );
			if ((int)a && a==(int)a) 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