| ||||||||||
| 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 <cstdio>
#include <math.h>
using namespace std;
#define PI 3.14
int main(int argc, const char * argv[])
{
int N;
int year = 1;
double x,y;
double s1;
double s2 = 50.0;
cin>>N;
for(int i = 0;i < N; i++)
{
year = 1;
cin>>x>>y;
s1 = PI*(x*x+y*y)/2;
if (s1<s2) {
printf("Property %d: This property will begin eroding in year %d.\n",i+1,year);
}
else{
while (s1>s2) {
s2 +=50.0;
year++;
}
printf("Property %d: This property will begin eroding in year %d.\n",i+1,year);
}
}
printf("END OF OUTPUT.");
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator