Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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++) {
- for (int j = 9; j >= l; j--) {
- for (int h = m; h <= 8; h++) {
- for (int g = 9; g >= n; g--) {
- if (i % 2 == 0 && j % 2 == 1 && h % 2 == 0 && g % 2 == 1){
- if (counter == 6) {
- return;
- }
- if (i == h && j == g) {
- System.out.println("Cannot change the same player.");
- } else {
- counter++;
- System.out.printf("%d%d - %d%d\n", i, j, h, g);
- }
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement