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:cin的状态

Posted by faononl at 2004-03-03 18:08:51 on Problem 1207
In Reply To:cin的状态 Posted by:Alcyone at 2004-03-02 23:06:20
懂了:)

> 读到文件末时cin的状态仍为真
> 再读一次就读不到数据,cin的状态变为假,应在此时跳出循环
> 就是说应该这样写才对:
> 
> while (cin) {
> cin>>a>>b;
> if (!cin) break;//////
> ...
> }
> 
> 和你现在的写法是等同的。

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