HDU 1088 Write a simple HTML Browser

来源:互联网 发布:淘宝支付转化率公式 编辑:程序博客网 时间:2024/06/16 00:32

HDU 1088 Write a simple HTML Browser

水题,就是会各种PE坑爹、、、不多说
#include <cstdio>#include <cstring>char word[81];int main(){int len, i;int cc = -1;while(scanf("%s", word)==1){if(strcmp(word, "<br>")==0){putchar('\n');cc = -1;}else if(strcmp(word, "<hr>")==0){if(cc != -1)putchar('\n');for(i=0; i<80; i++)putchar('-');putchar('\n');cc = -1;}else{len = strlen(word);if(cc+len+1 <= 80){if(cc != -1)putchar(' ');printf("%s", word);cc+=(len+1);}else{putchar('\n');printf("%s", word);cc = len;}}}putchar('\n');return 0;}


原创粉丝点击