Recursion & Backtracking
Jul 7, 2024 · 1 min read · 1-Recursion-Basic
#include "bits/stdc++.h"
using namespace std;
void solve(int n)
{
if(n==0) return;
solve(n-1);
cout<< n << " ";
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
int n; cin>>n;
solve(n);
...