Valik98

Untitled

Jul 3rd, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.29 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Test3 {
  4.     public static void main(String[] args) {
  5.         Scanner console = new Scanner(System.in);
  6.  
  7.             int K = Integer.parseInt(console.nextLine());
  8.             int L = Integer.parseInt(console.nextLine());
  9.             int M = Integer.parseInt(console.nextLine());
  10.             int N = Integer.parseInt(console.nextLine());
  11.  
  12.             int counter = 0;
  13.  
  14.             for (int i = K; i <= 8; i++){
  15.                 for (int j = 9; j >= L; j--){
  16.                     for (int s = M; s <= 8; s++){
  17.                         for (int b = 9; b >= N; b--){
  18.  
  19.                             if (i % 2 == 0 && j % 2 == 1 && s % 2== 0 && b % 2 == 1){
  20.  
  21.                                 if (counter == 6){
  22.                                     break;
  23.                                 }
  24.                                 if (i == s && j == b){
  25.                                     System.out.println("Cannot change the same player.");
  26.                                 }else{
  27.                                     counter++;
  28.                                     System.out.printf("%s%s - %s%s%n",i,j,s,b);
  29.                                 }
  30.  
  31.                             }
  32.                         }
  33.                     }
  34.  
  35.                 }
  36.             }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment