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:请教if(cin)/ if(scanf)的具体用法!

Posted by BearL at 2003-07-07 16:41:21 on Problem 1000
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:
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