HDU 1088 ( Write a simple HTML Browser )

1406 단어 htmlcStringbrowser
Problem : 1088 ( Write a simple HTML Browser )     Judge Status : Accepted
RunId : 5720130    Language : C++    Author : ssun
Code Render Status : Rendered By HDOJ C++ Code Render Version 0.01 Beta

#include<iostream>
#include<string>
using namespace std;

int main()
{
    int count=0,i;
    string s;
    string ss;
    while(cin>>s)
    {
        int len = s.size();
        if(s == "<br>")
        {
            ss += "
"; count = 0; continue; } if(s == "<hr>") { if(count != 0) ss += "
"; for(i=0; i<8; i++) ss += "----------"; ss += '
'; count = 0; continue; } count += len; if(count > 80) { ss += "
"; ss += s; count = len; continue; } if(count<=80) { if(count!=len && count!=80) ss += " "; count++; if(count > 80) { ss += "
"; ss += s; count = len; } else ss += s; } } cout<<ss<<endl; return 0; }

좋은 웹페이지 즐겨찾기