Advertisement
Guest User

Untitled

a guest
Jul 28th, 2015
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main(){
  6. string oldString, newString, words[2];
  7. cout << "old string :\n";
  8. getline(cin, oldString);
  9. oldString += ' ';
  10. int pos = oldString.find(" ");
  11. words[0] = oldString.substr(0, pos+1);
  12. words[1] = oldString.substr(pos+1, oldString.length());
  13. newString = words[1] + words[0];
  14. cout << newString << endl;
  15. system("pause");
  16. return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement