| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
PE死了#include<iostream>
#include<string>
using namespace std;
int main(){
string input;
int curlen = 0;
string hr(80,'-');
while(cin>>input){
if(input=="<br>"){ curlen=0; cout<<endl;}
else if(input=="<hr>"){ if(curlen) cout<<endl; curlen=0; cout<<hr<<endl;}
else if(curlen==0){
cout<<input; curlen+=input.length();
}else{
if(curlen+1+input.length()>80){
cout<<endl<<input; curlen=input.length();
}
else
cout<<" "<<input; curlen+=input.length()+1;
}
}
cout<<endl;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator