Advertisement
Spocoman

Substitute

Feb 13th, 2022 (edited)
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.30 KB | None | 0 0
  1. k = int(input())
  2. l = int(input())
  3. m = int(input())
  4. n = int(input())
  5. counter = 0
  6.  
  7. for i in range(k, 9):
  8.     for j in range(9, l - 1, -1):
  9.         for y in range(m, 9):
  10.             for z in range(9, n - 1, -1):
  11.                 if i % 2 == 0 and y % 2 == 0 and j % 2 == 1 and z % 2 == 1:
  12.                     if i == y and j == z:
  13.                         print("Cannot change the same player.")
  14.                     else:
  15.                         print(f"{i}{j} - {y}{z}")
  16.                         counter += 1
  17.                 if counter == 6:
  18.                     break
  19.             if counter == 6:
  20.                 break
  21.         if counter == 6:
  22.             break
  23.     if counter == 6:
  24.         break
  25.  
  26.  
  27. РЕШЕНИЕ С EXIT():
  28.  
  29. k = int(input())
  30. l = int(input())
  31. m = int(input())
  32. n = int(input())
  33. counter = 0
  34.  
  35. for i in range(k, 9):
  36.     for j in range(9, l - 1, -1):
  37.         for y in range(m, 9):
  38.             for z in range(9, n - 1, -1):
  39.                 if i % 2 == 0 and y % 2 == 0 and j % 2 == 1 and z % 2 == 1:
  40.                     if i == y and j == z:
  41.                         print("Cannot change the same player.")
  42.                     else:
  43.                         print(f"{i}{j} - {y}{z}")
  44.                         counter += 1
  45.                         if counter == 6:
  46.                             exit()
  47.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement