HDU 1088 - Write a simple HTML Browser
直接看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的更多相关文章
- 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 ...
- HDU 1088 Write a simple HTML Browser 有点恶心的字符串题
这题是从某个群里听别人在抱怨这题老是PE,打开status果然满眼的Presentation Error...于是闲着来做了一下. 其实挺水的,不过各种设定多一点,注意一点就行了. 一开始以为词数超过 ...
- HDU ACM 1088 Write a simple HTML Browser
意甲冠军:出现<br>总结,出现<hr>出口'-',今天的字加上各行的假设是长于80然后包,每个字之前,留下一个空白格,为了输出新行结束. #include<iostre ...
- 【HDOJ】1088 Write a simple HTML Browser
题目其实不难,但是要注意题目的要求,当前字数(>0)+当前单词长度+1若超过80则需要回车后,输出当前word,并且重新计数.这道题目的数据感觉比较水,不过测试的时候,最后使用fprintf输出 ...
- hdu Write a simple HTML Browser
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1088 对比输出 代码: #include <stdio.h> #include <s ...
- HDU 5795:A Simple Nim(博弈)
http://acm.hdu.edu.cn/showproblem.php?pid=5795 A Simple Nim Problem Description Two players take t ...
- hdu 5349 MZL's simple problem
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5349 MZL's simple problem Description A simple proble ...
- hdu 1851(A Simple Game)(sg博弈)
A Simple Game Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/65535 K (Java/Others)Tot ...
- 【HDU 5399】Too Simple
题 Description Rhason Cheung had a simple problem, and asked Teacher Mai for help. But Teacher Mai th ...
随机推荐
- VS C# 嵌入互操作类型
SQLDMO.Restore oRestore = new SQLDMO.RestoreClass(); SQLDMO.SQLServer oSQLServer = new SQLDMO.SQLSer ...
- JS正则表达式---分组
JS正则表达式---分组 之前写了一篇关于正则新手入门的文章,本以为对正则表达式相对比较了解 但是今天我又遇到了一个坑,可能是自己不够细心的原因吧,今天就着重和大家分享一下javascript正则表达 ...
- A Typical Homework(学生信息管理系统)
A Typical Homework(a.k.a Shi Xiong Bang Bang Mang) Hi, I am an undergraduate student in institute of ...
- (原)ubuntu上安装dlib
转载请注明出处: http://www.cnblogs.com/darkknightzh/p/5652791.html 参考网址: http://stackoverflow.com/questions ...
- (原)opencv中使用限制对比度自适应直方图均衡CLAHE
转载请注明出处: http://www.cnblogs.com/darkknightzh/p/5462656.html Ptr<CLAHE> clahe = createCLAHE(); ...
- httpd-vhosts.conf的配置
<VirtualHost *:80> DocumentRoot "D:\product\web\Public" ServerName demo.web.com Dire ...
- 【solr基础教程之二】索引
一.向Solr提交索引的方式 1.使用post.jar进行索引 (1)创建文档xml文件 <add> <doc> <field name="id"&g ...
- 如何在jQuery中使用 setInterval,setTimeout
当遇到setInterval,setTimeout与jquery混用的问题 时,直接按JavaScript中的语法写并不起作用,有以下两种解决方法. 方法1. 直接在ready中调用其他方法,会提示缺 ...
- php静态属性和静态方法
php静态属性和静态方法 2012-09-29 10:18 1518人阅读 评论(0) 收藏 举报 phpfunction 本php教程主要是学习php中静态属性和静态方法的使用方法和基本的示例. · ...
- 浅谈window.attachEvent
以前写 JavaScript 脚本时,事件都是采用object.event = handler;的方式初始化.这种方式对于 Internet Explorer.Mozilla/Firefox 和 Op ...