Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.plaf.IconUIResource;
- import java.util.Scanner;
- public class Substitude {
- 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 count = 0;
- boolean finish = false;
- for (int i = K; i <= 8; i++) {
- for (int j = 9; j >= L; j--) {
- for (int k = M; k <= 8; k++) {
- for (int l = 9; l >= N; l--) {
- if ((((i % 2 == 0 && k % 2 == 0)) && ((j % 2 == 1 && l % 2 == 1)))) {
- String num1 = "" + i + j;
- String num2 = "" + k + l;
- if (num1.equals(num2)) {
- System.out.println("Cannot change the same player.");
- } else {
- System.out.println(num1 + " " + "-" + " " + num2);
- count++;
- }
- }
- if (count == 6) {
- finish = true;
- break;
- }
- }
- if(finish){
- break;
- }
- }
- if(finish){
- break;
- }
- }
- if(finish){
- break;
- }
- }
- }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement