| ||||||||||
| 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 | |||||||||
想复杂了,纯粹水题In Reply To:Re:求教,总是过不了,但是自己感觉是没问题 Posted by:liujunjun at 2012-04-20 22:32:50 #include <iostream>
#include <cmath>
using namespace std;
int main()
{
int n,m=0;
float x,y,r,sum;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>x>>y;
r=sqrt(x*x+y*y);
sum=3.14*r*r/2;
while(sum>0)
{
sum=sum-50;
m++;
}
cout<<"Property "<<i+1<<": This property will begin eroding in year "<<m<<"."<<endl;
m=0;
}
cout<<"END OF OUTPUT."<<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