fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define pb push_back
  5. #define yes cout<<"YES\n";
  6. #define no cout<<"NO\n";
  7. const int N=3e5+7;
  8. ll T=1, n;
  9. void fib(ll x)
  10. {
  11. if(x > n)
  12. return;
  13.  
  14. cout << x << ' ';
  15. fib(x + 1);
  16. }
  17. void solve()
  18. {
  19. cin >> n;
  20. fib(1);
  21. }
  22. int main()
  23. {
  24. ios::sync_with_stdio(NULL);
  25. cin.tie(0);
  26. cout.tie(0);
  27.  
  28. // freopen("","r", stdin);
  29. // freopen("","w", stdout);
  30. while(T--)
  31. solve();
  32. return 0;
  33. }
  34.  
Success #stdin #stdout 0.01s 5320KB
stdin
5
stdout
1 2 3 4 5