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

运行跟结果一样啊,为什么老是wrong answer?!

Posted by Dawnee at 2010-11-14 11:41:56 on Problem 1005
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main()
{
    struct zuobiao
    {
        double x;
        double y;
    }M[10];
    int n,Z[10]={0},i=0;
    double area=0.0,r=0,R;
    scanf("%d",&n);
    while(i<n)
    {
        scanf("%lf %lf",&M[i].x,&M[i].y);
        R=sqrt(M[i].x*M[i].x+M[i].y*M[i].y);
        area=0.0;
        while(r<R)
        {
            Z[i]+=1;
            area=area+100;
            r=sqrt(area/3.14);
        }
        i++;
    }
    i=0;
    while(i<n)
    {
    printf("Property %d: This property will begin eroding in year %d.\n",i+1,Z[i]);
    i++;
    }
    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