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>>str>>n)可以判断结束啊?

Posted by franklee00 at 2009-10-13 12:54:40 on Problem 1001
In Reply To:为什么(cin>>str>>n)可以判断结束啊? Posted by:Raingo at 2009-08-08 16:09:10
> 我用的Visual c
> 不管怎么样都结束不了输入!
> 如果control c程序又直接结束离开!
> 
> 新手请教,还请赐教!
其实判断终止就是向系统发送EOF消息,当系统收到EOF时,while(cin>>str>>n)就知道要结束输入了。

向系统发送EOF的方法:

在windows系统下,同时按Ctrl+z 。(不是Ctrl+c哦,呵呵~~)
在Unix/Linux系统系,按d键

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