| ||||||||||
| 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;
const double PI=3.141592654;
int main()
{
int year,n,i;
double x[1000],y[1000],s[1000],r[1000];
cin>>n;
for(i=0;i<n;i++)
{
cin>>x[i]>>y[i];
r[i]=sqrt(x[i]*x[i]+y[i]*y[i]);
s[i]=(PI*r[i]*r[i])/2;
}
for(i=0;i<n;i++)
{
year=1;
if(s[i]<50.0)
{
cout<<"Property "<<i+1<<" This property will begin eroding in year "
<<year<<"."<<endl;
}
else
{
year=2;
while(s[i]>50*year)
{
year++;
}
cout<<"Property "<<i+1<<" This property will begin eroding in year "
<<year<<"."<<endl;
}
}
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