- #include<iostream>
- #include<string>
- usingnamespacestd;
- intre(80);
- intmain()
- {
- freopen("in.txt","r",stdin);
- freopen("out.txt","w",stdout);
- stringtemp;
- inti,l,j;
- while(cin>>temp)
- {
- l=temp.size();
- if(temp=="<br>")
- {
- cout<<endl;
- re=80;
- continue;
- }
- if(temp=="<hr>")
- {
- if(re!=80)
- {
- cout<<endl;
- cout<<"--------------------------------------------------------------------------------"<<endl;
- }
- else
- cout<<"--------------------------------------------------------------------------------"<<endl;
- re=80;
- continue;
- }
- if(l>=re)
- {
- cout<<endl;
- cout<<temp;
- re=80-l;
- continue;
- }
- if(re==80)
- {
- cout<<temp;
- re=re-l-1;
- continue;
- }
- if(l+1<=re)
- {
- cout<<""<<temp;
- re=re-l-1;
- }
- else
- {
- cout<<endl;
- cout<<temp;
- re=80-l;
- }
- }
- cout<<endl;
- return0;
- }
2271
最新推荐文章于 2020-04-17 11:36:04 发布