#include #include #include #include #include #include using namespace std; int main() { string line; getline( cin, line ); istringstream iss{line}; vector whisper; copy( istream_iterator{iss}, istream_iterator{}, back_inserter(whisper) ); copy( begin(whisper), end(whisper), ostream_iterator{cout, " "} ); cout << endl; if ( whisper.empty() ) return 1; auto less_length = [](string const& a, string const& b) { return a.length() < b.length(); }; auto max = max_element(begin(whisper), end(whisper), less_length); auto min = min_element(begin(whisper), end(whisper), less_length); swap(*max, *min); copy( begin(whisper), end(whisper), ostream_iterator{cout, " "} ); cout << endl; transform( begin(whisper), end(whisper), begin(whisper), [](string const& s) { if ( isupper( s.front() ) ) return "Super"s + s; else return s; } ); copy( begin(whisper), end(whisper), ostream_iterator{cout, " "} ); cout << endl; auto v = remove_if( begin(whisper), end(whisper), [](string const& s) { return ! all_of( begin(s), end(s), ::isalpha); } ); whisper.erase( v, end(whisper) ); copy( begin(whisper), end(whisper), ostream_iterator{cout, " "} ); cout << endl; return 0; }