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

Re:我的答案和他的一模一样呀,也大写了,怎么还不对呀?!!!帮帮我了,小妹谢了!!!!!!!!!!

Posted by liangxiao at 2006-05-26 19:31:55 on Problem 1005
In Reply To:我的答案和他的一模一样呀,也大写了,怎么还不对呀?!!!帮帮我了,小妹谢了!!!!!!!!!! Posted by:y05zyg at 2006-03-07 20:46:10
> # include <iostream.h>
> # include<math.h>
> const double q=acos(-1);
> int main()
> {
> 	int t,n;
> 	float x,y;
> 	double r;
> 	cin>>t;
> 	for(int i=1;i<=t;i++)
> 	{
> 		cin>>x>>y;
> 		if(x!=0&&y>=0)
> 		{
> 		r=sqrt(x*x+y*y);
> 		n=(int)(q*r*r/2)/50;		
> 		cout<<"Property"<<' ' <<i<<":This property will begin eroding in year "<<n+1<<endl;		
> 		}
> 	}
> 		cout<<"END OF OUTPUT"<<endl;
> 		return 0;
> }
我觉得最大的问题是r=sqrt(x*x+y*y);取开方又做他的乘方没有必要,而且会产生计算误差,可以避免。

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