#include <iostream>
#include <string>
using namespace std;
int main()
{
 string str;
 int count=0;
 while(cin>>str)
 {
  if(str=="<br>")
  {
   cout<<endl;
   count=0;
   continue;
  }
   if(str=="<hr>")
  {
   if(count>0)
    cout<<endl;
   for(int i = 0; i < 80; i++)
               cout << '-';
   cout<<endl;
   count=0;
   continue;
  }
   if(count==0)
   {
    cout<<str;
    count=str.length();
    continue;
   }
   if(count+str.length()+1<=80)
   {
    count=count+str.length()+1;
    cout<<" "<<str;
    continue;
   }
   else
   {
    count=str.length();
    cout<<endl;
    cout<<str;
   }
 }
 cout<<endl;
 return 0;
}

posted on 2012-05-08 12:35  梨子  阅读(132)  评论(0)    收藏  举报