7-8 sdut-统计工龄
知识点:sorted函数(dict默认10比2小)
n=int(input())
num=[int(x) for x in input().split()]
mp={}
for i in num:
mp.setdefault(i,0)
mp[i]=mp[i]+1
for i,j in sorted(mp.items()):
print("{}:{}".format(i,j))
知识点:sorted函数(dict默认10比2小)
n=int(input())
num=[int(x) for x in input().split()]
mp={}
for i in num:
mp.setdefault(i,0)
mp[i]=mp[i]+1
for i,j in sorted(mp.items()):
print("{}:{}".format(i,j))