Advertisement
gosuodin

chuoi dao

Jun 9th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include<iostream>
  2. #include<string>
  3. using namespace std;
  4.  
  5.  
  6. int dao(char s[30])
  7. {
  8. if (strlen(s) == 0) return 0;
  9. else
  10. {
  11. cout << s[strlen(s) - 1];
  12. s[strlen(s) - 1] = '\0';
  13. }
  14. dao(s);
  15. }
  16. void main()
  17. {
  18. char s[30];
  19. cout << "Nhap chuoi:";
  20. fflush(stdin);
  21. cin.getline(s, 30);
  22. cout << "Chuoi dao nguoc la:";
  23. dao(s);
  24. system("pause");
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement