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 ...
随机推荐
- php常用mysql函数
mysql_affected_rows: 得到 MySQL 最后操作影响的列数目. mysql_close: 关闭 MySQL 伺服器连线. mysql_connect: 开启 MySQL 伺服器连线 ...
- rub、sass和compass的安装
长话短说,直接进入正题. [ruby安装] ruby下载网址:http://rubyinstaller.org/downloads/ 选择适合自己电脑的版本: 下载完成后直接双击安装,记得勾选加入环境 ...
- python运维开发(二十五)---cmdb开发
内容目录: 浅谈ITIL CMDB介绍 Django自定义用户认证 Restful 规范 资产管理功能开发 浅谈ITIL TIL即IT基础架构库(Information Technology Infr ...
- Django学习(七) 创建第一个Django项目
如果这是你第一次使用Django,你必须进行一些初始设置.即,您将需要自动生成一些代码,建立了Django项目. 从命令行.cd进入一个目录,你想要存储您的代码,然后运行以下命令: django-ad ...
- Database Go and JSON
在使用Go开发web项目的过程中, 数据库读写操作与JSON格式的输入输出是两块最基础的模块, Go的标准库已经帮我们做了很多, 熟悉database/sql与encoding/json这两个库能帮我 ...
- mysqldump 的方式来搭建master-->slave 的复制架构
1.master 上要满足的最小条件: 1.server_id 已经设置成了一个非0值 2.log_bin 配置好binlog 2.slave 上要满足的最小条件 1.server_id 已经设置成了 ...
- [Errno 11004] getaddrinfo failed
该程序是在用python发送邮件的时候出现的 出现这个错误的时候,证明连不上你的帐号,或者登录不上服务器~超时连接 检查下自己的帐号或者服务器的编写有没有正确
- 理解JMS规范中消息的传输模式和消息持久化
http://blog.csdn.net/aitangyong/article/category/2175061 http://blog.csdn.net/aitangyong/article/det ...
- 把所有的QT的类都过一遍脑子
http://doc.qt.io/qt-5/classes.html 这样就明白QT提供的全部功能了,避免重复造轮子,或者给自己开发带来麻烦-
- 开源欣赏wordpress之文章新增页面如何实现。
本地网址http://localhost/wordpress/wp-admin/post-new.php 进而找到post-new.php页面. 进入之后, require_once( dirname ...