Advertisement
Patey

Untitled

May 28th, 2020
950
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.22 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4. int x;
  5. void f(int x)
  6. {
  7.     cout<<x<<" ";
  8.     while(x>0)
  9.     {
  10.         f(x-1);
  11.         x--;
  12.        cout<<endl;
  13.  
  14.     }
  15. }
  16. int main()
  17. {cin>>x;
  18.     f(x);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement