Back to task

158 symbols python3
Mon Aug 11 20:24:03 2014 z423x5c6
import sys
a={}
for i in sys.stdin:
 i=i.strip('\n').split()
 try:
  a[i[0]]+=int(i[1])
 except:
  a[i[0]]=int(i[1])
for k in sorted(a.keys()):
 print(k,a[k])


Leave a comment

Parsed as Markdown

Login to leave a comment