728x90
반응형
단순 정렬 문제이다. 출력 방식에 주의하자(한 줄에 10개씩 출력)
d = {'1':'one', '2':'two', '3':'three', '4':'four', '5':'five',
'6':'six', '7':'seven', '8':'eight', '9':'nine', '0':'zero'}
M, N = map(int, input().split())
li = []
for i in range(M, N+1):
s = ' '.join([d[c] for c in str(i)])
li.append([i, s])
li.sort(key=lambda x:x[1])
for i in range(len(li)):
if i%10 == 0 and i!= 0:
print()
print(li[i][0], end=' ')
728x90
반응형
'Agorithm > 백준 알고리즘' 카테고리의 다른 글
백준 알고리즘 2018번 수들의 합 5(python) (0) | 2021.02.24 |
---|---|
백준 알고리즘 1969번 DNA(python) (0) | 2021.02.24 |
백준 알고리즘 1531번 투명(python) (0) | 2021.02.24 |
백준 알고리즘 1380번 귀걸이(python) (2) | 2021.02.24 |
백준 알고리즘 1251번 단어 나누기(python) (0) | 2021.02.24 |