Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main(){
- string oldString, newString, words[2];
- cout << "old string :\n";
- getline(cin, oldString);
- oldString += ' ';
- int pos = oldString.find(" ");
- words[0] = oldString.substr(0, pos+1);
- words[1] = oldString.substr(pos+1, oldString.length());
- newString = words[1] + words[0];
- cout << newString << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement