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

求大神解答下,我这个也过不了。。。

Posted by l942345 at 2013-11-24 16:03:03 on Problem 1005
#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:
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