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 hawk at 2005-04-05 12:56:07 on Problem 1001
In Reply To:scanf通用的做法是判断返回值是不是EOF,也就是-1 Posted by:frkstyc at 2005-04-05 12:47:26
数据没问题的时候一样的
万一数据有问题,比如结束的时候,多出一点东西,但是又比完整的数据要少
这个时候判断eof就不会结束,因为这个时候可能读入了部分数据,scanf的返回值就是成功读入的数据的数目

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