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

这样也能过啊,太神奇了!!!!!!!!!!!!!!!!!!!!!!!!

Posted by 695375900 at 2009-04-05 21:21:36 on Problem 3100
#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:
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