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(void) { double n,a,b,i(1); cin>>n>>a; double kk=pow(10.0,n); b=(a+1)/kk; a=a/kk; while(1) { if((int)pow(i+b,2)-(int)pow(i+a,2)>=1) { cout<<(int)pow(i+b,2)<<endl; break; } 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