Advertisement
CR7CR7

task_nine

Feb 27th, 2021
1,123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. import math
  2. n = int(input())
  3. left_sum = 0
  4. right_sum = 0
  5.  
  6. for i in range(n):
  7.     current_num = int(input())
  8.     left_sum += current_num
  9.  
  10. for i in range(n):
  11.     current_num = int(input())
  12.     right_sum += current_num
  13.  
  14. if left_sum == right_sum:
  15.     print(f'Yes, sum = {left_sum}')
  16. else:
  17.     diff = abs(left_sum - right_sum)
  18.     print(f'No, diff = {diff}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement