题解 | #图片整理#
图片整理
http://www.nowcoder.com/practice/2de4127fda5e46858aa85d254af43941
使用哈希表来解决该问题,非常简单。代码如下:
while True:
try:
s = input()
except:
break
dic = {}
for i in s:
if dic.get(i):
dic[i] += 1
else:
dic[i] = 1
for i in sorted(dic):
for j in range(dic[i]):
print(i, end='')
print()