Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- int n;
- cin >> n;
- function<void(int)> Print = [&](int n) {
- if (n == 1) {
- cout << 1 << " ";
- } else {
- Print(n - 1);
- cout << n << " ";
- }
- };
- Print(n);
- return 0;
- }
Add Comment
Please, Sign In to add comment