Advertisement
BbJLeB

01. Matrix

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