Untitled

mail@pastecode.io avatar
unknown
c_cpp
19 days ago
423 B
0
Indexable
Never
#include <iostream>
#include <set>
#include <algorithm>
using namespace std;

void rec(int x) {
    if(x == 0) {
        return;
    }
    
    rec(x - 1);
    cout << x << " ";
}
int main()
{
    ios_base::sync_with_stdio(false);
    rec(5);
   return 0;
}
// rec(5) | cout << 5 << endl;
// rec(4) | cout << 4 << endl;
// rec(3) | cout << 3 << endl;
// rec(2) | cout << 2 << endl;
// rec(1) | cout << 1 << endl;
// rec(0)
Leave a Comment