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 |
help me !#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator