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

WA一个奇葩的原因

Posted by bzdxh at 2014-12-04 17:43:27 on Problem 3764
让我们看一组数据:
4
0 1 3
1 2 4
1 3 6


乍一看,怎么好像跟样例没什么区别?但是,如果你是直接while not eof do的话,你的程序就会莫名其妙地处理剩下的那些空行,然后就会输出一些乱七八糟的东西。

坑爹啊!~~~~~~~~~~~~~~~~~~~~~~~~~

所以,这个故事告诉我们,以后读数据,要先读一行再判断文件是否结束。
【I bought a watch last year!!!!!】

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