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:就算是水题吧...但是小弟读入字符串的时候用scanf过了..用gets就不行...很诧异啊...大家谁能解释下?

Posted by Lur at 2011-05-24 23:21:59 on Problem 1654
In Reply To:就算是水题吧...但是小弟读入字符串的时候用scanf过了..用gets就不行...很诧异啊...大家谁能解释下? Posted by:bsshanghai at 2010-11-28 18:35:05
gets()能读空行,如果两组数据之间有一个空行,用gets()就会出现问题,而scanf()就可以将多余的空行过滤掉。
例如
2
5

825
用gets()读数据的时候就会出项问题~~~~~

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