fabbe680

Reverse String

Nov 28th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. string s1;
  9. int numChar;
  10.  
  11. getline(cin,s1);
  12.  
  13. numChar = s1.length();
  14.  
  15. for(int i = numChar - 1; i >= 0; i--) {
  16. cout << s1[i];
  17. }
  18.  
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment