Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class E06substitute {
- 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 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