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 todh at 2012-09-18 12:22:09 on Problem 1005
#include <iostream>
#include <cstdlib>
#include <iomanip>
#include <cmath>
using namespace std;

int main(int argc, char *argv[])
{
    double sum=0.0;
    int year;
    double lx,ly;
    double r = 0.0,newr = 0.0;
    cin>>year;
    for(int i=0;i<year;i++){
       cin>>lx>>ly;
       sum = 0.0;
       r = sqrt(lx*lx+ly*ly);      
       while(newr<r){
           sum = sum+ 50;
           newr = sqrt(2*sum/3.1415926);    
       }
       cout<<"Property "<<i+1<<": This property will begin eroding in year "<<(int)(sum/50)<<"."<<endl;   
    }
    cout<<"END OF OUTPUT."<<endl;  
    system("PAUSE"); 
    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