-
//zoj1099 HTML
-
//Accepted 1099 C ++ 00:00.01 836K
-
#include <cstdio>
-
#include <iostream>
-
#include <string>
-
using namespace std;
-
string s;
-
int len;
-
void solve()
-
{
-
if (s.compare("<hr>") == 0){
-
if(len!=0) cout << endl;
-
for (int i=0; i<80; ++i) cout << "-";
-
cout << endl;
-
len = 0;
-
return;
-
}
-
if (s.compare("<br>") == 0){
-
cout << endl;
-
len = 0;
-
return;
-
}
-
sign:
-
if (len == 0){
-
cout << s;
-
len += s.length();
-
if (len > 80){
-
cout << endl;
-
len = 0;
-
}
-
return;
-
}
-
len += s.length()+1;
-
if (len > 80){
-
cout << endl;
-
len = 0;
-
goto sign;
-
}
-
cout << ' ' << s;
-
}
-
int main()
-
{
-
#ifdef ONLINE_JUDGE
-
#else
-
freopen("1099.txt","r",stdin);
-
freopen("res.txt","w",stdout);
-
#endif
-
while (cin >> s)
-
solve();
-
cout << endl;
-
#ifdef ONLINE_JUDGE
-
#else
-
fclose(stdin);
-
fclose(stdout);
-
#endif
-
return 0;
-
}
zoj1099 HTML
最新推荐文章于 2019-02-08 18:43:36 发布