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:为什么这个程序可以AC,它一旦遇到回车就输出,可是题目中的sample input可以接受回车,总体输出

Posted by fangyixiang at 2007-07-31 10:33:13 on Problem 2271
In Reply To:为什么这个程序可以AC,它一旦遇到回车就输出,可是题目中的sample input可以接受回车,总体输出 Posted by:acmfan at 2006-08-17 12:05:39
> #include<stdio.h>
> #include<string.h>
> void main()
> {
>  char t[81];
>  int l,m,j=0,len=0;
>   while(scanf("%s",t)==1)
>   {
>       if(t[0]=='<')
>       {
>        if(t[1]=='b')
>        {len=0;printf("\n");}
>        else
>        {
> 	if(len!=0)
> 	 printf("\n");
> 	len=0;
> 	for(j=0;j<80;j++)
> 	 printf("-");
> 	printf("\n");
>        }
>       }//1th if
>       else
>       {
>        len=len+1+strlen(t);
>        if(len>80)
>        {printf("\n");
> 	len=strlen(t);
>        }
>        printf("%s ",t);
>        }
>  }
>  printf("\n");
> }

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