| ||||||||||
| 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 | |||||||||
总是Wrong Answer,大家帮看看#include <iostream>
#include <cstdlib>
#include <iomanip>
#include <cmath>
using namespace std;
int main(int argc, char *argv[])
{
double sum=0.0;
int year;
double lx,ly;
double r = 0.0,newr = 0.0;
cin>>year;
for(int i=0;i<year;i++){
cin>>lx>>ly;
sum = 0.0;
r = sqrt(lx*lx+ly*ly);
while(newr<r){
sum = sum+ 50;
newr = sqrt(2*sum/3.1415926);
}
cout<<"Property "<<i+1<<": This property will begin eroding in year "<<(int)(sum/50)<<"."<<endl;
}
cout<<"END OF OUTPUT."<<endl;
system("PAUSE");
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator