hdu Write a simple HTML Browser
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1088
对比输出
代码:
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <iostream>
#include <ctype.h>
#include <iomanip>
#include <queue>
#include <map>
#include <stdlib.h>
using namespace std; char word[]; int main()
{
int len,i;
int cp=-;
while(scanf("%s",word)==){
if(strcmp(word,"<br>")==){
putchar('\n');
cp=-;
}
else if(strcmp(word,"<hr>")==){
if(cp!=-)
putchar('\n');
for(i=;i<;i++)
putchar('-');
putchar('\n');
cp=-;
}
else{
len=strlen(word);
if(cp+len+<){
if(cp!=-)
putchar(' ');
printf("%s",word);
cp+=(len+);
}
else{
putchar('\n');
printf("%s",word);
cp=len;
}
}
}
putchar('\n');
return ;
}
hdu Write a simple HTML Browser的更多相关文章
- HDU 5795 A Simple Nim(简单Nim)
p.MsoNormal { margin: 0pt; margin-bottom: .0001pt; text-align: justify; font-family: Calibri; font-s ...
- HDU 5794 - A Simple Chess
HDU 5794 - A Simple Chess题意: 马(象棋)初始位置在(1,1), 现在要走到(n,m), 问有几种走法 棋盘上有r个障碍物, 该位置不能走, 并规定只能走右下方 数据范围: ...
- HDU 4974 A simple water problem(贪心)
HDU 4974 A simple water problem pid=4974" target="_blank" style="">题目链接 ...
- hdu 4972 A simple dynamic programming problem(高效)
pid=4972" target="_blank" style="">题目链接:hdu 4972 A simple dynamic progra ...
- 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 1088 - Write a simple HTML Browser
直接看sample input = = 又一道模拟. #include <iostream> #include <string> #include <cstdio> ...
- HDU ACM 1088 Write a simple HTML Browser
意甲冠军:出现<br>总结,出现<hr>出口'-',今天的字加上各行的假设是长于80然后包,每个字之前,留下一个空白格,为了输出新行结束. #include<iostre ...
- HDU 5794 A Simple Chess (容斥+DP+Lucas)
A Simple Chess 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5794 Description There is a n×m board ...
随机推荐
- 在borland c++ builder 中使用 google test (gtest)
google test version: 1.6 c++ builder version: xe6 1 download google test 1.6 2 unzip the zip file. T ...
- POJ 2405 Beavergnaw (计算几何-简单的问题)
Beavergnaw Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 6203 Accepted: 4089 Descri ...
- 【C语言探索之旅】 开宗明义及第一课:什么是编程?
内容简介 1.课程大纲 2.第一部分第一课:什么是编程? 3.第一部分第二课预告:工欲善其事,必先利其器 课程大纲 不知道为什么,一直对C语言有一种很深厚的“情怀”(类似老罗对锤子手机的那种),说 ...
- MonkeyRunner源代码分析Android通信设备
正如前面<谁动了我的截图?--Monkeyrunner takeSnapshot方法源代码跟踪分析>所述,本文主要会尝试描写叙述android的自己主动化測试框架MonkeyRunner到 ...
- OpenCV——Delaunay三角 [转载]
从这个博客转载 http://blog.csdn.net/raby_gyl/article/details/17409717 请其它同学转载时注明原始文章的出处! Delaunay三角剖分是1934年 ...
- 玩转Web之servlet(一)---怎样创建一个servlet
Servlet概念:servlet就是用java编写的服务器端的小程序,用来完成下B/S架构(即浏览器和服务器架构)下客户端请求的响应处理. servlet通常在容器中运行Tomcat是常见的serv ...
- ProgressMonitorInputStream
Swing类包中有一个很有用的流过滤器,ProgressMonitorInputStream,它可以自动弹出一个对话框,监视已经读取了多少流. 进度监视器流使用InputStream类的availab ...
- 大教堂与集市(The Cathedral and the Bazaar)读书笔记
大教堂与集市The Cathedral and the Bazaar,一本不像计算机方面的计算机书籍 命令式管理,适合和奴隶共事目标共识型管理,适合和自由人共事 心性气层 只要眼多,bug好找 黑客开 ...
- UVA - 10714 Ants
最多时间就是每仅仅蚂蚁选择最久的爬行方式 最少时间就是每仅仅蚂蚁选择最快地爬行方式 #include<iostream> #include<map> #include<s ...
- System.ComponentModel.BackgroundWorker在WinForm中的异步使用
为了防止操作过程中界面卡死,和WinForm搭配最适合的就是BackgroundWorker了.BackgroundWorker 类 using System; using System.Compon ...