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

究正一下你的错误:(正确答案应该是5而不是6)

Posted by 0810311106 at 2009-08-26 11:04:04 on Problem 2959 and last updated at 2009-08-26 11:08:16
In Reply To:这是计算机精度跟现实实现的不同么? D = 11, d = 3, s = 1的时候 明显是6嘛.. 计算机算出的竟然是5 为什么? Posted by:akheyun at 2009-07-29 10:39:49
大哥,我服了你了,本来答案就是5,怎么是6呢?,贴个代码作参考。
#include"iostream"
#include"math.h"
using namespace std;
int main()
{
	int n;
	cin>>n;
	while(n--)
	{
		double D,d,s;
	    long num;
		cin>>D>>d>>s;
		num=floor(3.1415926/asin((d+s)/(D-d)));
	    cout<<num<<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