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:请帮忙看看吧。老是WA

Posted by ozy4dm at 2009-05-28 15:44:46 on Problem 1003
In Reply To:Re:请帮忙看看吧。老是WA Posted by:wxh_8989 at 2009-05-28 15:18:45
> 
> A了十分感谢你!!!
> 想再请问一下  为什么while(int(s*100)<int(a*100))会WA的?
> 

The cast to "int" rounds down the figures after the decimal fractions.

ex)
case
s=0.1234
a=0.1235

s < a ===> true

but

int(s*100) < int(a*100) ===> false

because
int(s*100) == 12
int(a*100) == 12

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