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