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 uestc254136 at 2009-04-26 23:31:30 on Problem 1003
In Reply To:大牛来看:这道题目本身似乎有一点点问题(与精确的计算结果相比) Posted by:WestMount at 2007-04-04 10:18:59
> 若输入1.45,则按照人工进行的精确的计算,答案应为5。因为(1/2+1/3+1/4+1/5+1/6准确地等于1.45). 但自己的代码答案为6。这样的代码也被接受了,出题者没考虑过这个情况?这算不算题目本身的问题呢?

c++里没有分数表达式 只有化成小数做精确计算 一旦分数相加可约分 精度就有问题了 

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