Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Substitute {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. int k = Integer.parseInt(scanner.nextLine());
  8. int l = Integer.parseInt(scanner.nextLine());
  9. int m = Integer.parseInt(scanner.nextLine());
  10. int n = Integer.parseInt(scanner.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 h = m; h <= 8; h++) {
  17. for (int g = 9; g >= n; g--) {
  18. if (i % 2 == 0 && j % 2 == 1 && h % 2 == 0 && g % 2 == 1){
  19. if (counter == 6) {
  20. return;
  21. }
  22.  
  23. if (i == h && j == g) {
  24. System.out.println("Cannot change the same player.");
  25. } else {
  26. counter++;
  27. System.out.printf("%d%d - %d%d\n", i, j, h, g);
  28.  
  29. }
  30.  
  31. }
  32.  
  33. }
  34.  
  35. }
  36.  
  37. }
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement