Advertisement
Trawka011

Untitled

Oct 13th, 2022
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.23 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. void f(int n) {    
  4.     if (n == 0)
  5.     {
  6.         return ;
  7.     }
  8.     cout << n % 10 << endl;
  9.     f(n / 10);
  10. }
  11. int main() {
  12.     int n;
  13.     cin >> n;    
  14.     f(n);
  15.     return 0;
  16. }
  17.  
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement