Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package PodgotovkaZaIzpit;
- import java.util.Scanner;
- public class Substitute {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int k = Integer.parseInt(scanner.nextLine());
- int l = Integer.parseInt(scanner.nextLine());
- int m = Integer.parseInt(scanner.nextLine());
- int n = Integer.parseInt(scanner.nextLine());
- int counter = 0;
- for (int i = k; i <= 8; i++)
- {
- if (i % 2 == 1) { continue; }
- for (int o = 9; o >= l; o--)
- {
- if (o % 2 == 0) { continue; }
- for (int p = m; p <= 8; p++)
- {
- if (p % 2 == 1) { continue; }
- for (int q = 9; q >= n; q--)
- {
- if (q % 2 == 0)
- {
- continue;
- }
- if (i == p && o == q)
- {
- System.out.println("Cannot change the same player.");
- }
- else
- {
- counter++;
- System.out.printf("%d%d - %d%d\n",i, o, p, q );
- }
- if (counter == 6) {return; }
- }
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment