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 yuecongwei at 2008-04-28 16:25:45 on Problem 1005
#include<iostream>
#include<cmath>
using namespace std;
const double PI=3.141592654;
int main()
{
	int year,n,i;
	double x[1000],y[1000],s[1000],r[1000];
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>x[i]>>y[i];
		r[i]=sqrt(x[i]*x[i]+y[i]*y[i]);
		s[i]=(PI*r[i]*r[i])/2;
	}
	
	for(i=0;i<n;i++)
	{
		year=1;
		if(s[i]<50.0)
		{
			cout<<"Property "<<i+1<<" This property will begin eroding in year "
				<<year<<"."<<endl;
		}
		else
		{
			year=2;
			while(s[i]>50*year)
			{
				year++;
			}
			cout<<"Property "<<i+1<<" This property will begin eroding in year "
				<<year<<"."<<endl;
		}
				
	}
	cout<<"END OF OUTPUT."<<endl;
	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