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

有时间在这里奇怪还不如仔细找找程序的问题

Posted by frkstyc at 2006-03-12 22:33:28 on Problem 1079
In Reply To:一个奇怪的现象! Posted by:zhujie at 2006-03-12 22:30:42
> 我这是有两个程序:
> 在我机子上输入
> 76 89
> 第一个程序运行如下:  第二个程序运行如下:
> 1/1                   1/1
> 2/3                   3/4
> 3/4                   4/5
> 4/5                   5/6
> 7/9                   6/7
> 24/31                 23/27
> 31/40                 29/34
> 38/49                 35/41
>                       41/48
>                       76/89
> 很显然第一个程序的结果是错的,不应该有2/3这一项。
> 因为 76/89 = 0.8539  1/1 = 1  2/3 = 0.6667
> 所以(1/1 - 76/89) < (76/89 - 2/3)
> 也就是说1/1 这项比2/3这项更接近76/89 所以2/3这项是错的,
> 
> 而第二个程序运行我不敢说一定对的,但我还没看出有什么错误。
> 
> 奇怪就奇怪第一个程序AC了,可第二个程序WA了
> 这是怎么回事啊!
> 我的机子上装的的VC6.0.
> 这两个程序都是用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