Advertisement
tungSfer

tu dien ac nghiem

Jan 16th, 2022
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. # TỪ ĐIỂN
  2. def check(a):
  3.     # s=str(a)
  4.     for i in a:
  5.         if not(i.isnumeric()): return False
  6.     return True
  7. k=int(input())
  8. if k<0 or k>10:
  9.     print("INVALID INPUT")
  10. else:
  11.     dic ={}
  12.     for i in range(k):
  13.         a,b=map(str,input().split())
  14.         dic[a]=b
  15.        
  16.     t=0
  17.     ti=1
  18.     for v in dic.values():
  19.         if check(v)==False: continue
  20.         else:
  21.             t+=int(v)
  22.             ti*=int(v)
  23.     print(t,ti)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement