fork(2) download
  1. #include <iostream>
  2. #include <vector>
  3. #include <string>
  4. #include <algorithm>
  5.  
  6. using namespace std;
  7.  
  8. int main() {
  9. for (int i=0;i <4;i++)
  10. {
  11. string word;
  12. string rword = "";
  13. cin >> word;
  14.  
  15. vector<string> wrd;
  16. for (int i = 0; i < word.length(); i++)
  17. {
  18. wrd.push_back(word.substr(i, 1));
  19. }
  20. reverse(word.begin(), word.end());
  21.  
  22. for (int i = 0; i < word.size(); i++)
  23. {
  24. rword += word[i];
  25. }
  26. cout << rword <<endl;
  27. }
  28. return 0;
  29. }
Success #stdin #stdout 0s 3476KB
stdin
Standard input is empty
stdout