Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Demo {
- 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 countShift = 0;
- for (int k = K; k <= 8; k++) {
- if (k % 2 != 0) {
- continue;
- }
- for (int l = 9; l >= L; l--) {
- if (l % 2 == 0) {
- continue;
- }
- for (int m = M; m <= 8; m++) {
- if (m % 2 != 0) {
- continue;
- }
- for (int n = 9; n >= N; n--) {
- if (countShift == 6){
- break;
- }
- if (n % 2 == 0) {
- continue;
- }
- if (k == m && l == n) {
- System.out.println("Cannot change the same player.");
- }else {
- countShift++;
- System.out.printf("%d%d - %d%d%n", k, l, m, n);
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment