Advertisement
35657

Untitled

Apr 13th, 2024
985
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1.  
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. void reverse(int number) {
  7.     if (number < 10) {
  8.         cout << number;
  9.     }
  10.     else {
  11.         cout << number % 10;
  12.         reverse(number / 10);
  13.     }
  14. }
  15.  
  16.  
  17. int main() {
  18.     setlocale(LC_ALL, "ru");
  19.  
  20.     reverse(7563);
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement