| ||||||||||
| 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:请教if(cin)/ if(scanf)的具体用法!In Reply To:Re:请教if(cin)/ if(scanf)的具体用法! Posted by:hong_liming at 2003-07-06 22:45:29 一定要先读入再判断吗?
还见过有人用
if(cin>>...)
//Proc
这样有问题么?
> 我是这么用的
> void main()
> {
> do
> {
> cin>>.......
> if(!cin)break;
> //processing.....
> }while(true);
> }
>
> 至于scanf(),返回值应该是实际读入数据项的个数,如果返回零就表示没有读入任何数据
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator