desislava_topuzakova

Untitled

Feb 22nd, 2022
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class zad6 {
  4. public static void main(String[] args) {
  5. Scanner scanner=new Scanner(System.in);
  6. int k=Integer.parseInt(scanner.nextLine());
  7. int l=Integer.parseInt(scanner.nextLine());
  8. int m=Integer.parseInt(scanner.nextLine());
  9. int n=Integer.parseInt(scanner.nextLine());
  10. int count=0;
  11. for(int i=k;i<=8;i++){
  12. if(count==6){
  13. break;
  14. }
  15. for (int j = 9; j>=l ; j--) {
  16. if(count==6){
  17. break;
  18. }
  19. for (int o = m; o <=8 ; o++) {
  20. if(count==6){
  21. break;
  22. }
  23. for (int p = 9; p >=n ; p--) {
  24. if(count==6){
  25. break;
  26. }
  27. if(i%2==0&&o%2==0&&j%2==1&&p%2==1){
  28. if(i==o&&j==p){
  29. System.out.print("Cannot change the same player.\n");
  30. } else {
  31. count++;
  32. System.out.printf("%d%d - %d%d\n", i, j, o, p);
  33. }
  34. }
  35. }
  36. }
  37. }
  38.  
  39.  
  40.  
  41. }
  42.  
  43.  
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment