Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:为什么这个程序可以AC,它一旦遇到回车就输出,可是题目中的sample input可以接受回车,总体输出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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator