| ||||||||||
| 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 | |||||||||
Re:求大牛们点拨一下,翻阅过discuss所有主题,不知道为什么WAIn Reply To:求大牛们点拨一下,翻阅过discuss所有主题,不知道为什么WA Posted by:MadDigerati at 2007-02-23 19:02:15 > #include<iostream>
> #include<cmath>
> using namespace std;
> int main()
> {
> int n,t,p;
> long a,b;
> float d;
> cin>>n;
> while(n>0)
> {
> cin>>a>>b;
> if(a==b)
> {
> p=0;
> }
> else
> {
> d=sqrt(4.0*(b-a));
> t=(int)d;
> if(t<d) p=t;
> else p=t-1;
> }
> cout<<p<<endl;
> n--;
> }
> return 0;
> }
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator