aneliabogeva

Matrix

May 21st, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. a = int(input())
  2. b = int(input())
  3. c = int(input())
  4. d = int(input())
  5.  
  6. for first_row_first_number in range(a, b+1):
  7. for first_row_second_number in range(a, b+1):
  8. for second_row_first_number in range(c, d+1):
  9. for second_row_second_number in range(c, d+1):
  10. sum_main_diagonal = first_row_first_number + second_row_second_number
  11. sum_second_diagonal = first_row_second_number + second_row_first_number
  12. if sum_main_diagonal == sum_second_diagonal:
  13. if first_row_first_number != first_row_second_number and second_row_first_number != second_row_second_number:
  14. print(f"{first_row_first_number}{first_row_second_number}")
  15. print(f"{second_row_first_number}{second_row_second_number}")
  16. print()
Advertisement
Add Comment
Please, Sign In to add comment