| ||||||||||
| 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<cmath>
using namespace std;
int main()
{
double a,b;
while(scanf("%lf%lf",&a,&b),a!=0&&b!=0)
{
int i,j;
for(i=0;i<1000000;i++)
if(pow(i,b)>=a)break;
if(pow(i,b)-a>=a-pow(i-1,b))
printf("%d\n",i-1);
else 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