Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int K, L, M, N;
- cin >> K >> L >> M >> N;
- if (K % 2 == 1)
- K++;
- if (M % 2 == 1)
- M++;
- if (L % 2 == 0)
- L++;
- if (N % 2 == 0)
- N++;
- int substitutes = 0;
- for (int k = K; k <= 8 && substitutes < 6; k += 2) // [K,8]
- {
- for (int l = 9; l >= L && substitutes < 6; l -= 2) // [9,L]
- {
- for (int m = M; m <= 8 && substitutes < 6; m += 2) // [M,8]
- {
- for (int n = 9; n >= N && substitutes < 6; n -= 2) // [9,N]
- {
- if (k == m && l == n)
- cout << "Cannot change the same player.\n";
- else
- {
- cout << k << l << " - " << m << n << endl;
- substitutes++;
- }
- }
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment