Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
究正一下你的错误:(正确答案应该是5而不是6)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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator