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

晕啊,真的是啊…分数和名字之间有可能不止一个空格用 sscanf() 分开的话要小心

Posted by yyii1111 at 2012-02-11 18:00:04 on Problem 2153
In Reply To:输入数据有多于空格,注意啊 Posted by:forgotaboutdre at 2011-04-19 20:18:01
> ....数据后有多于空格,我了个去,这么水的题花了我这么长时间,结果发现是输入问题。。。。

总之我之前用 sscanf(input,"%d %[]",&x,str); 把分数和名字分开…WA
换成        
str = input;
while(str[0]!=' ') ++str;
while(str[0]==' ') ++str;

就AC了……

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