Advertisement
tungSfer

tu dien

Jan 16th, 2022
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. a = []
  2. for _ in range(int(input())):
  3.     s1, s2 = input().split()
  4.     if s1.isdecimal():
  5.         a.append(int(s1))
  6.     if s2.isdecimal():
  7.         a.append(int(s2))
  8. if len(a) == 0:
  9.     print("INVALID INPUT")
  10. else:
  11.     sum = 0
  12.     res = 1
  13.     for i in a:
  14.         sum += i
  15.         res *= i
  16.     print(sum, res)
  17.    
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement