| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:cin的状态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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator