Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

1005题C代码,不知为什么不AC啊!

Posted by rangercyh at 2009-10-25 14:48:33
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator