3.19 PAT1064 乙级 python

朋友数

n = int(input())
lst = list(input().split())
nos = []
for i in lst:
	no = 0
	for j in i:
		no += int(j)
	if no not in nos:
		nos.append(no)
print(len(nos))
nos.sort()
for i in nos:
	if i ==max(nos):
		print(i)
	else:
		print(i,end = ' ')

猜你喜欢

转载自blog.csdn.net/qq_39782006/article/details/88667950
今日推荐