| ||||||||||
| 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 | |||||||||
没事分享一下AC代码,容易PE的题目//下面是已经AC的代码
#include <stdio.h>
#include <string.h>
int main()
{
char a[81];
int l;
int s = 0;
int first = 0;
while (scanf("%s",&a)==1)
{
l = strlen(a);
if (strcmp(a,"<br>") == 0)
{
printf("\n");
s = 0; first = 0;
}
else if (strcmp(a,"<hr>") == 0)
{
if (s != 0) printf("\n");
printf("--------------------------------------------------------------------------------\n");
s = 0; first = 0;
}
else if (s + l + 1> 80) {printf("\n%s",a); s=l; first = 1;}
else
{
if (first) printf(" ");
printf("%s",a);
first = 1; s += l + 1;
}
}
printf("\n");
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator