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

1005 代码

Posted by haijunsm at 2015-01-12 23:07:47 on Problem 1005
额滴神
   提交了四次 只是因为最后一个小数点,,,代码如下;
# include<iostream>
# include<math.h>
using namespace std;
int main()
{
	int i;
	int k = 0;
	float a, b,r,Sz;
	float s = 50;
	cin >> i;
	for (k=0; k < i;++k)
	{
		cin>> a >> b;
		r = sqrt(a*a + b*b);
		
		Sz = 1.5707963*r*r;
		while ( s < Sz)
		{
			s = s + 50;
						
		}
		
		cout <<"Property "<<k+1<<": This property will begin eroding in year "<< s/50<<"."<<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