直接看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. ios10 适配问题总结

    看各个大神整理而成 1.检查版本问题 不可以像下面这样用 #define isiOS10 ([[[[UIDevice currentDevice] systemVersion] substringTo ...

  2. (转)在Eclipse中使用JUnit4进行单元测试

    原地址:http://blog.csdn.net/andycpp/article/details/1327147

  3. StringList 自定义快速排序

    unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms ...

  4. JavaScript this 局部变量全局变量 作用域 作用域链 闭包

    从阮老师博客的一道测试题说起: 代码段一: var name = "The Window"; var object = { name : "My Object" ...

  5. 异常处理与调试2 - 零基础入门学习Delphi51

    异常处理与调试2 让编程改变世界 Change the world by program Delphi 异常类 利用异常机制,就是允许写代码时可以假设:如果用户可以得到子程序调用或计算的结果,这些结果 ...

  6. VS2012 的MVC4实例

    原文链接:http://wenku.baidu.com/link?url=nkq-UZd-Ui83Nuoh66n4KqdwK4V_zzKqakmmG6VBgq2BfWlMiPhz1JXN9R3CWxN ...

  7. [转]浅谈C/C++内存泄露及其检测工具

    转自:http://www.cnblogs.com/taoxu0903/archive/2007/10/27/939261.html 对于一个c/c++程序员来说,内存泄漏是一个常见的也是令人头疼的问 ...

  8. Shell使用

    http://www.cnblogs.com/hbt19860104/archive/2012/08/14/2638952.html http://blog.csdn.net/tttyd/articl ...

  9. C# 客户端发送http请求代码 (c/s)

    public class RestClient { private string BaseUri; public RestClient(string baseUri) { this.BaseUri = ...

  10. apache+php+mysql常见集成环境安装包

    http://www.thinksaas.cn/group/topic/33/ apache+php+mysql是常见php环境,在windows下也称为WAMP,对于初学者自选版本搭建总是会遇到一些 ...