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

是的,每行最后可能有若干个空格,需要gets() 去除,

Posted by forestgump2012 at 2024-02-13 20:06:24 on Problem 1251
     for(i=1;i<n;i++){
            gets(sp);       // 去除每行后的多个空格
            scanf("%c%d",&ch,&k);
            u=ch-'A';
            for(j=1;j<=k;j++){
                getchar();     // 去除每个字符前一个空格
                scanf("%c%d",&ch,&ct);

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