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 |
根本就是水题#include<iostream> #include<math.h> using namespace std; int main() { int n,m,i,j,k,n1,n2; while(cin>>n>>m) { if(n==0&&m==0)break; k=(int)pow(n,1.0/m); n1=(int)pow(k,m*1.0); n2=(int)pow(k+1,m*1.0); if(n-n1<n2-n)cout<<k<<endl; else { cout<<k+1<<endl; } } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator