Advertisement
Guest User

Untitled

a guest
May 21st, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4. void v(string s, int n = -2){
  5. if (n == -2)
  6. n = s.size() - 1;
  7. if (n >= 0){
  8. cout << s[n];
  9. v(s, n - 1);
  10. }
  11. }
  12. int main(){
  13. string x;
  14. getline (cin, x);
  15. v(x);
  16. cout << endl;
  17. system("pause");
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement