Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sstream>
- #include <algorithm>
- #include <iostream>
- #include <string>
- using namespace std;
- string switcharoo(string s)
- {
- istringstream in(s) ;
- string result ;
- string token ;
- while ( in >> token )
- {
- if (token.length() > 3)
- random_shuffle( &token[1], &token[token.length()-1]) ;
- result += token ;
- result += ' ' ;
- }
- return result ;
- }
- int main(){
- string stmt;
- getline(cin, stmt);
- stmt = switcharoo(stmt);
- cout << stmt;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement