#include <cstdio>
#include <cstring>
char buf[81];
char Ident[2][5] = {"<br>", "<hr>"};
int main()
{
int index = 0;
while( scanf("%s", buf) != EOF )
{
if( strcmp(buf, Ident[0]) == 0 )
{
printf("\n");
index = 0;
}
else if( strcmp(buf, Ident[1]) == 0 )
{
if( index != 0 )
{
printf("\n");
index = 0;
}
for(int i=0;i<80;i++)
{
printf("-");
}
printf("\n");
}
else
{
int len = strlen(buf);
if( index == 0 )
{
index = len;
printf("%s",buf);
}
else
{
if( index + len + 1 >= 80 )
{
printf("\n%s", buf);
index = len;
}
else
{
index = index + len + 1;
printf(" %s", buf);
}
}
}
}
return 0;
}
ZOJ1099-HTML
最新推荐文章于 2022-11-17 23:13:24 发布