ZOJ1099字符串水题
来源:互联网 发布:手机蓝牙软件下载 编辑:程序博客网 时间:2024/05/19 12:29
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
int main()
{
int count=0;
char word[81];
while(scanf("%s",word)!=EOF)
{
if(strcmp(word,"<hr>")==0)
{
if(count!=0)
printf("\n");
int i;
for(i=0;i<80;i++)
printf("-");
printf("\n");
count=0;
}
else if(strcmp(word,"<br>")==0)
{
printf("\n");
count=0;
}
else
{
if(count+strlen(word)+(count==0?0:1)>80)
{
printf("\n%s",word);
count=strlen(word);
}
else
{
if(count!=0) printf(" ");
printf("%s",word);
count+=strlen(word)+1;
}
}
}
printf("\n");
return 0;
}
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
int main()
{
int count=0;
char word[81];
while(scanf("%s",word)!=EOF)
{
if(strcmp(word,"<hr>")==0)
{
if(count!=0)
printf("\n");
int i;
for(i=0;i<80;i++)
printf("-");
printf("\n");
count=0;
}
else if(strcmp(word,"<br>")==0)
{
printf("\n");
count=0;
}
else
{
if(count+strlen(word)+(count==0?0:1)>80)
{
printf("\n%s",word);
count=strlen(word);
}
else
{
if(count!=0) printf(" ");
printf("%s",word);
count+=strlen(word)+1;
}
}
}
printf("\n");
return 0;
}
0 0
- ZOJ1099字符串水题
- [水]ZOJ1099
- zoj1099 HTML
- ZOJ1099-HTML
- zoj1099 HTML
- 杭电1088&zoj1099 Write a simple HTML Browser
- 字符串水题
- poj1936~~字符串水题
- 字符串水题_CJ
- 字符串”水“题
- hdu 1048 字符串水题
- hdu 1062字符串水题
- 字符串水题 N - ?(>_o)!
- uva1339(字符串水题)
- POJ 3080 字符串水题
- 【字符串水题】HDU2617Happy 2009
- hdu 5773 字符串水题
- 古代密码 字符串水题
- 十六进制的字符串与十六进制数的转换
- serial port communication by java
- Scheme语言深入
- 在线考试系统的倒计时
- Bash Shellshock(Bash远程代码执行)漏洞分析及利用思路
- ZOJ1099字符串水题
- POJ - 1743 Musical Theme (后缀数组求不可重叠最长重复子串)
- 小米笔试第一题:回文数
- 函数调用约定
- 进制转换
- 关于注解版Spring 延迟加载报错问题 “could not initialize proxy - no Session“
- C++ Sockets Library
- MapReduce 编程 系列二 编写简单mapper
- virtual 共享目录