Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <queue>
- #include <algorithm>
- #include <vector>
- #include <algorithm>
- #include <set>
- #include <cstring>
- #include <cmath>
- #include <map>
- #include <fstream>
- using namespace std;
- void f(int x) {
- if(x > 10) {
- return;
- }
- f(x + 1);
- cout << x << " ";
- }
- int main() {
- f(1);
- return 0;
- }
- /*
- f(1) --> f(2) | cout << 1 << " ";
- f(2) --> f(3) | cout << 2 << " ";
- f(3) --> f(4) | cout << 3 << " ";
- f(4) --> f(5) | cout << 4 << " ";
- f(5) --> f(6) | cout << 5 << " ";
- f(6) --> f(7) | cout << 6 << " ";
- f(7) --> f(8) | cout << 7 << " ";
- f(8) --> f(9) | cout << 8 << " ";
- f(9) --> f(10) | cout << 9 << " ";
- f(10) --> f(11)| cout << 10 << " ";
- f(11) --> return
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement