mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
38 lines
1.1 KiB
C++
38 lines
1.1 KiB
C++
|
#include<cstdio>
|
||
|
#include<cstring>
|
||
|
char a[81];
|
||
|
int main()
|
||
|
{
|
||
|
int p=0;
|
||
|
while(scanf("%s",a+1)!=EOF)
|
||
|
{
|
||
|
int len=strlen(a+1);
|
||
|
if(a[1]=='<')
|
||
|
{
|
||
|
if(a[2]=='b')printf("\n");
|
||
|
else{
|
||
|
if(p)printf("\n");
|
||
|
for(int i=1;i<=80;i++)printf("-");
|
||
|
printf("\n");
|
||
|
}
|
||
|
p=0;
|
||
|
}else if(p==0)
|
||
|
{
|
||
|
for(int i=1;i<=len;i++)printf("%c",a[i]);
|
||
|
p=len;
|
||
|
}else if(p+len>=80)
|
||
|
{
|
||
|
printf("\n");
|
||
|
for(int i=1;i<=len;i++)printf("%c",a[i]);
|
||
|
p=len;
|
||
|
}else
|
||
|
if(p+len<80){
|
||
|
printf(" ");
|
||
|
for(int i=1;i<=len;i++)printf("%c",a[i]);
|
||
|
p+=len+1;
|
||
|
}
|
||
|
}
|
||
|
printf("\n");
|
||
|
return 0;
|
||
|
}
|