题目链接: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的更多相关文章

  1. HDU 5795 A Simple Nim(简单Nim)

    p.MsoNormal { margin: 0pt; margin-bottom: .0001pt; text-align: justify; font-family: Calibri; font-s ...

  2. HDU 5794 - A Simple Chess

    HDU 5794 - A Simple Chess题意: 马(象棋)初始位置在(1,1), 现在要走到(n,m), 问有几种走法 棋盘上有r个障碍物, 该位置不能走, 并规定只能走右下方 数据范围: ...

  3. HDU 4974 A simple water problem(贪心)

    HDU 4974 A simple water problem pid=4974" target="_blank" style="">题目链接 ...

  4. hdu 4972 A simple dynamic programming problem(高效)

    pid=4972" target="_blank" style="">题目链接:hdu 4972 A simple dynamic progra ...

  5. 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 ...

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

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

  7. HDU 1088 - Write a simple HTML Browser

    直接看sample input = = 又一道模拟. #include <iostream> #include <string> #include <cstdio> ...

  8. HDU ACM 1088 Write a simple HTML Browser

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

  9. 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 ...

随机推荐

  1. jquery处理页面元素

    处理父级页面中的元素 $(parent.document).find('#hidSendPerson').val(val);$(parent.document).find('#btnGo').clic ...

  2. SpringMVC+Spring+Hibernate的小样例

    Strusts2+Spring+Hibernate尽管是主流的WEB开发框架,可是SpringMVC有越来越多的人使用了.确实也很好用.用得爽! 这里实现了一个SpringMVC+Spring+Hib ...

  3. NYOJ 745 蚂蚁问题(两)

    蚂蚁的难题(二) 时间限制:1000 ms  |  内存限制:65535 KB 难度:3 描写叙述 下雨了,下雨了.蚂蚁搬家了. 已知有n种食材须要搬走,这些食材从1到n依次排成了一个圈.小蚂蚁对每种 ...

  4. Directx11学习笔记【三】 第一个D3D11程序

    在先前的解决方案中新建一个新的Win32项目FirstD3D11Demo.在写代码之前,我们必须先添加dx11所需要的库.为了链接dx库,右键项目选择属性->vc++目录,在包含目录中添加你所安 ...

  5. 开源Math.NET基础数学类库使用(05)C#解析Delimited Formats数据格式

    原文:[原创]开源Math.NET基础数学类库使用(05)C#解析Delimited Formats数据格式 开源Math.NET基础数学类库使用系列文章总目录:   1.开源.NET基础数学计算组件 ...

  6. LeetCode——Add Binary

    Given two binary strings, return their sum (also a binary string). For example, a = "11" b ...

  7. Chapter 1 Securing Your Server and Network(9):使用Kerberos用于身份验证

    原文:Chapter 1 Securing Your Server and Network(9):使用Kerberos用于身份验证 原文出处:http://blog.csdn.net/dba_huan ...

  8. Redis是新兴的通用存储系统-为何Redis要比Memcached好用

    GitHub版本地址: https://github.com/cncounter/translation/blob/master/tiemao_2014/Redis_beats_Memcached/R ...

  9. (4)通过调用hadoop的java api实现本地文件上传到hadoop文件系统上

    (1)首先创建java project 选择eclipse菜单上File->New->Java Project. 并命名为UploadFile. (2)加入必要的hadoop jar包 右 ...

  10. poj 1664 把平果

    这个问题可分为两个子问题:什么时候m<n时刻,例如3苹果放在4阿菜,和3苹果放3一样的. 所以m<n时,f[m][n]=f[m][m]; 当m>=n时.可分为两种放法,一种为至少有一 ...