直接看sample input = =

又一道模拟。

 #include <iostream>
#include <string>
#include <cstdio>
using namespace std;
string s;
int main()
{
// freopen("date.out","w",stdout);
int m=;
while(cin>>s)
{
if(s=="<br>")
{
cout<<endl;
m=;
}
else if(s=="<hr>")
{
if(m!=)
{
cout<<endl;
m=;
}
cout<<string(,'-')<<endl;
}
else
{
if(m+s.length()+>)
{
cout<<endl;
m=;
}
if(m)
{
cout<<' ';
m++;
}
cout<<s;
m+=s.length();
if(m>=)
{
cout<<endl;
m=;
}
}
}
cout<<endl;
}

HDU 1088 - Write a simple HTML Browser的更多相关文章

  1. HDOJ/HDU 1088 Write a simple HTML Browser(HTML字符串)

    Problem Description If you ever tried to read a html document on a Macintosh, you know how hard it i ...

  2. HDU 1088 Write a simple HTML Browser 有点恶心的字符串题

    这题是从某个群里听别人在抱怨这题老是PE,打开status果然满眼的Presentation Error...于是闲着来做了一下. 其实挺水的,不过各种设定多一点,注意一点就行了. 一开始以为词数超过 ...

  3. HDU ACM 1088 Write a simple HTML Browser

    意甲冠军:出现<br>总结,出现<hr>出口'-',今天的字加上各行的假设是长于80然后包,每个字之前,留下一个空白格,为了输出新行结束. #include<iostre ...

  4. 【HDOJ】1088 Write a simple HTML Browser

    题目其实不难,但是要注意题目的要求,当前字数(>0)+当前单词长度+1若超过80则需要回车后,输出当前word,并且重新计数.这道题目的数据感觉比较水,不过测试的时候,最后使用fprintf输出 ...

  5. hdu Write a simple HTML Browser

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1088 对比输出 代码: #include <stdio.h> #include <s ...

  6. HDU 5795:A Simple Nim(博弈)

    http://acm.hdu.edu.cn/showproblem.php?pid=5795 A Simple Nim Problem Description   Two players take t ...

  7. hdu 5349 MZL's simple problem

    题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5349 MZL's simple problem Description A simple proble ...

  8. hdu 1851(A Simple Game)(sg博弈)

    A Simple Game Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/65535 K (Java/Others)Tot ...

  9. 【HDU 5399】Too Simple

    题 Description Rhason Cheung had a simple problem, and asked Teacher Mai for help. But Teacher Mai th ...

随机推荐

  1. parentViewController

    获取创建自己的上一级视图 self.parentViewController 并且强制转换

  2. The run destination XXX的 iPhone is not valid for Running the scheme 'Day7通讯录Demo'.

    错误:

  3. .Net Memory -- Windbg基本命令

    命令 解释 .cls 清空命令窗口屏幕 .load dllfullpath 加载debugger扩展dll如SOS sosex psscor. .loadby dll moduleName 加载deb ...

  4. poj1716 Integer Intervals(差分约束)

    转载请注明出处: http://www.cnblogs.com/fraud/          ——by fraud Integer Intervals Time Limit: 1000MS   Me ...

  5. 一大坨GoogleAPI的学习笔记之一(oAuth2.0)

    官方文档地址:https://developers.google.com/accounts/docs/OAuth2InstalledApp 最近Ubuntu下VGA接口无端的不能用了,木有心情翻译了, ...

  6. Memcache入门知识

    Memcache适合做缓存,是一款管理内存的很小的软件,实现对内存数据的管理,一般我们用memcache存储临时数据,因为内存不能储存永久化的数据,内存里面的数据,断电就消失了. memcache可以 ...

  7. 图片ppm编码格式

    ppm图片有2种格式, ASCII格式和binary格式. (1)ppm头部分 由三部分组成,这三部分由回车或换行分割,但PPM的标准中是要求空格. 第一行通常是P3或P6,说明是PPM格式: 第二行 ...

  8. php二分查找

    // 递归版本 function bin_sch($arr,$low,$high,$val) { if($low<$high){ $mid = intval(($low+$high)/2); i ...

  9. Javascript 文件的同步加载与异步加载

    HTML 4.01 的script属性 charset: 可选.指定src引入代码的字符集,大多数浏览器忽略该值.defer: boolean, 可选.延迟脚本执行,相当于将script标签放入页面b ...

  10. WPF笔记(1.1 WPF基础)——Hello,WPF!

    原文:WPF笔记(1.1 WPF基础)--Hello,WPF! Example 1-1. Minimal C# WPF application// MyApp.csusing System;using ...