Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define x first
- #define y second
- using namespace std;
- typedef long long ll;
- int n;
- void f1(int f, int s, int t, int c)
- {
- if (c == 1) cout << f << ' ' << s << endl;
- else
- {
- f1(f, t, s, c - 1);
- cout << f << ' ' << s << endl;
- f1(t, s, f, c - 1);
- }
- }
- int main()
- {
- ios_base::sync_with_stdio(0);
- cin.tie(0);
- cin >> n;
- f1(1, 2, 3, n);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement