Advertisement
CR7CR7

task_nine

Feb 27th, 2021
1,003
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data Copied
Advertisement