Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Test3 {
- public static void main(String[] args) {
- Scanner console = new Scanner(System.in);
- int K = Integer.parseInt(console.nextLine());
- int L = Integer.parseInt(console.nextLine());
- int M = Integer.parseInt(console.nextLine());
- int N = Integer.parseInt(console.nextLine());
- int counter = 0;
- for (int i = K; i <= 8; i++){
- for (int j = 9; j >= L; j--){
- for (int s = M; s <= 8; s++){
- for (int b = 9; b >= N; b--){
- if (i % 2 == 0 && j % 2 == 1 && s % 2== 0 && b % 2 == 1){
- if (counter == 6){
- break;
- }
- if (i == s && j == b){
- System.out.println("Cannot change the same player.");
- }else{
- counter++;
- System.out.printf("%s%s - %s%s%n",i,j,s,b);
- }
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment