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