#include #include #include using namespace std; void main ( ) { const string BreakLine = "
"; const string BlankLine = "

"; string FileLine; string modedString; string httpString; string modURL; int len; int pos; int Blpos; cout << "" << endl; cout << "" << endl << "" << endl; cout << "" << endl; cout << "Untitled Document" << endl; cout << "" << endl << "" << endl; getline( cin, FileLine); while ( !cin.eof( )) { if (FileLine.empty( ) ) { cout << BlankLine << endl; } else if ((FileLine.find("http")!= string::npos) || (FileLine.find("Http") != string::npos)) { modedString = FileLine; pos = modedString.find("http"); while ( pos != string::npos ) { len = modedString.length( ); httpString = modedString.substr(pos, len ); Blpos = httpString.find(" "); if (Blpos != string::npos) { len = httpString.length( ); modUrl = httpString.substr(0, Blpos); modedString.erase(pos); cout << modedString << " "; cout << modUrl << ""; modedString = httpString.substr( Blpos, len); pos = modedString.find("http"); }//end if else if ( Blpos = string::npos ) { modUrl = httpString.substr(0, len); modedString.erase(pos); cout << modedString << " "; cout << modUrl << ""; modedString= ""; pos = modedString.find("http"); }//end else }//end while cout << modedString << BreakLine << endl; }//end else else { FileLine = FileLine + BreakLine; cout << FileLine << endl; }//end else getline( cin, FileLine); }//end while cout << "" << endl << "" << endl; }