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 了
代码如下 :
题目地址 :
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;
}

#include<iostream>
















































相关阅读 更多 +