Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <algorithm>
- using std::max;
- #include <iostream>
- using std::cin, std::cout, std::endl;
- #include <string>
- using std::getline, std::string;
- auto input()
- -> string
- {
- string s;
- getline( cin, s );
- return s;
- }
- auto main()
- -> int
- {
- const string s = input();
- cout << s << endl;
- const int len = int( s.length() );
- const int shortening = (len >= 10 and s[9] == 'w'? 32 : 17);
- const int new_len = max( 0, len - shortening );
- const int new_start = len - new_len;
- cout << endl;
- cout << s.substr( new_start, new_len ) << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement