文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>HDOJ HDU 1088 Write a simple HTML Browser ACM 1088 IN HDU

HDOJ HDU 1088 Write a simple HTML Browser ACM 1088 IN HDU

时间:2010-08-18  来源:MiYu

//MiYu原创, 转帖请注明 : 转载自 ______________白白の屋

题目地址 :
      http://acm.hdu.edu.cn/showproblem.php?pid=1088
      模拟HTML 语言...............
标准的模拟题..............PE了好久, 终于A 了
代码如下 :
//MiYu原创, 转帖请注明 : 转载自 ______________白白の屋

#include<iostream>
#include <string>
using namespace std;
string hr = "--------------------------------------------------------------------------------";
int main()
{
    string str, str1;
    int count = 0;
    while ( cin >> str )
    {
        int len = str.size ();
        if ( str == "<br>" )
        {
             cout << endl;
             count =0;
        }
        else if ( str == "<hr>" )
        {
            if ( count )
            {
                 cout << endl; 
            }
            cout << hr << endl;
            count = 0;
        }
        else
        {
            if ( count + len + 1 <= 80 ) 
            {
                if ( count )
                {
                     cout << " ";
                     count ++;
                }
                cout << str;
                count += len;
            }
            else
            {
                cout << endl;
                count = len;
                cout << str;
            }
        }
    }
    cout << endl;
    return 0;
}
排行榜 更多 +
我狙打得贼六2安卓版

我狙打得贼六2安卓版

飞行射击 下载
疯狂坦克争霸战最新版

疯狂坦克争霸战最新版

飞行射击 下载
王者狙击精英最新版

王者狙击精英最新版

飞行射击 下载