HDU 1088 Write a simple HTML Browser

Source: Internet
Author: User
Tags strcmp

HDU 1088 Write a simple HTML Browser

Write a simple HTML Browser

Time limit:2000/1000 MS (java/others) Memory limit:65536/32768 K (java/others)
Total submission (s): 8560 Accepted Submission (s): 2406


Problem descriptionif you ever tried to read a HTML document on a Macintosh, you know how hard it was if no Netscape is INS Talled.
Now, who can forget to install a HTML browser? This was very easy because most of the times you don't need one on a MAC because there are a acrobate Reader which is native To MAC. But if you ever need one and what does?
Your task is to write a small html-browser. It should only display the content of the Input-file and knows only the HTML commands (tags) <br> which is a linebre AK and

Inputthe input consists of a text you should display. This text consists of words and HTML tags separated by one or more spaces, tabulators or newlines.
A word is a sequence of letters, numbers and punctuation. For example, "abc,123" was one word, but "ABC, 123" was the words, namely "ABC," and "123". A word is always shorter than bayi characters and does not contain any ' < ' or ' > '. All HTML tags is either <br> or

Outputyou should display the the resulting text using this rules:
. If you read a word in the input and the resulting line does not get longer than chars, print it, else print it on a new Line.
. If you read a <br> with the input, start a new line.
. If you read a The last line was ended by a newline character.

Sample Inputhallo, Dies ist eine Ziemlich lange Zeile, die in Html aber nicht umgebrochen wird. <br> Zwei <br> <br> produzieren Zwei newlines. Es gibt auch noch das tag

Sample Outputhallo, Dies ist eine Ziemlich lange Zeile, die in Html aber nicht umgebrochen wird. Zwei Produzieren Zwei newlines. Es gibt auch noch das tag--------------------------------------------------------------------------------was einen Trenner darstellt. Zwei----------------------------------------------------------------------------------------------------------- -----------------------------------------------------Produzieren zwei Horizontal Rulers.  Achtung mehrere Leerzeichen irritieren Html genauso wenig wie mehrere Leerzeilen. This is a pure simulation, but for me such slag can be made to be similar, PE n (n>=5) times, first with Cin.getline PE, and later found in the processing of each line <=80 is not a space, and then found in the processing #include <iostream> #include <cstring> #include <fstream>using namespace Std;int main () {//ifstream CI N ("1.txt");//char c[1100]; int l,n=0; int t=0; while (cin>>c) {L=strlen (c); if (strcmp (c, "<br>") ==0) {cout <<endl; n=0; R=v; } else if (strcmp (c, "

HDU 1088 Write a simple HTML Browser

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.