Advertisement
Josif_tepe

Untitled

Oct 3rd, 2021
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4. #include <fstream>
  5. #include <cmath>
  6. using namespace std;
  7. void rec(int number) {
  8.     if(number == 0) {
  9.         return;
  10.     }
  11.     cout << number % 10 << " ";
  12.     rec(number / 10);
  13. }
  14. int main() {
  15.     int n;
  16.     cin >> n;
  17.     rec(n);
  18.     return 0;
  19. }
  20.  
  21.  
  22. // rec(4512)
  23. // rec(451)
  24. // rec(45)
  25. // rec(4)
  26. // rec(0)
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement