#include <stdio.h> #include <string.h> int main() { int count; char buf[82]; count = 0; while(scanf("%s", buf) != EOF) { if(!strcmp(buf, "<br>")) { putchar('\n'); count = 0; } else if(!strcmp(buf, "<hr>")) { if(count) putchar('\n'); for(count = 80; count; --count) putchar('-'); putchar('\n'); } else { if(count + strlen(buf) + 1 > 80) { printf("\n%s", buf); count = strlen(buf); } else { if(count) putchar(' '); printf("%s", buf); count += strlen(buf) + 1; } } } return 0; }