| ||||||||||
| 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 | |||||||||
1005题C代码,不知为什么不AC啊!#include <stdio.h>
#include <math.h>
int main()
{
double PI = acos(-1.0);
double eps = 1e-8;
double x = 0,y = 0;
int n;
int j;
double r2 = 0;
double limit2 = 0;
int year = 0;
scanf("%d",&n);
for (j = 0; j < n; j++)
{
scanf("%lf%lf",&x,&y);
r2 = (x * x + y * y) * PI;
for (year = 0; r2 > limit2 + eps; year++)
{
limit2 = 100.0 * (year + 1);
}
printf("Property %d: This property will begin eroding in year %d.\n", j+1, year);
}
printf("END OF OUTPUT.\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