Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.BufferedReader;
- import java.io.IOException;
- import java.io.InputStreamReader;
- public class Substitute {
- public static void main(String[] args) throws IOException {
- BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
- int k = Integer.parseInt(reader.readLine());
- int l = Integer.parseInt(reader.readLine());
- int m = Integer.parseInt(reader.readLine());
- int n = Integer.parseInt(reader.readLine());
- int substitute = 0;
- for (int i = k; i <= 8; i++) {
- for (int j = 9; j >= l; j--) {
- for (int o = m; o <= 8; o++) {
- for (int p = 9; p >= n; p--) {
- if (i % 2 != 0 || o % 2 != 0 || j % 2 == 0 || p % 2 == 0) {
- continue;
- } else if (i == o && j == p){
- System.out.println("Cannot change the same player.");
- } else {
- substitute++;
- System.out.println("" + i + j + " - " + o + p);
- }
- if (substitute >= 6){
- return;
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment