s=input()
alphabet=''
alpha_list=[]
num_sum=0
answer=''
for i in s:
if i.isalpha():
alphabet+=i
else:
num_sum+=int(i)
for i in alphabet:
alpha_list.append(i)
alpha_list.sort()
for i in alpha_list:
answer+=i
if num_sum==0:
print(answer)
else:
print(answer+str(num_sum))
join()
s = input()
alpha_list = []
num = 0
for i in s:
if i.isalpha():
alpha_list += i
else:
num += int(i)
alpha_list.sort()
alpha = "".join(alpha_list)
if num==0:
print(alpha)
else:
print(alpha + str(num))
- 모든 문자열 합치기 위해 join() 사용 : for문 보다 훨씬 simple
alpha = "".join(alpha_list)