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 anyunhua at 2007-05-16 21:00:23
#include<iostream.h>
#include<math.h>
void main()
{	const   double pi=3.1415926;
	float a[1000][2];
	int n,i,j,m;int year=0;
	double r;
	cin>>n;
	
	for(i=0;i<n;i++)
		for(j=0;j<2;j++)
			cin>>a[i][j];
			
		for(i=1;i<=n;i++)
	{	
		for(m=50;;m+=50)
		{	r=sqrt(double(2*m)/pi);
			year++;
			if(r>a[i-1][0]&&r>a[i-1][1])
			{	
				cout<<"Property "<<i<<":"<<" This property will begin eroding in year "<<year<<'.'<<endl;
				break;
			}

		}
		year=0;
			
	}
	cout<<"END OF OUTPUT."<<endl;
		
}
	
				
	
		
	
		
	




	


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