job다한 공부

백준 1427번: 소트인사이드-파이썬(python) 본문

백준/정렬

백준 1427번: 소트인사이드-파이썬(python)

시현한 하루 2022. 9. 24. 22:58
728x90

https://www.acmicpc.net/problem/1427

 

1427번: 소트인사이드

첫째 줄에 정렬하려고 하는 수 N이 주어진다. N은 1,000,000,000보다 작거나 같은 자연수이다.

www.acmicpc.net


 

1
2
3
4
5
6
7
8
9
10
#소트인사이드
string_list=list(input()) #문자열로 리스트 안에 하나씩 저장
 
int_list = list(map(int, string_list)) #int형 변환
int_list.sort() #정렬
int_list.reverse() #내림차순 정렬 위해 거꾸로 정렬
 
for i in range(len(int_list)):
  print(int_list[i],end="")
 
cs
728x90

'백준 > 정렬' 카테고리의 다른 글

백준 2750번: 수 정렬하기-파이썬(python)  (1) 2022.09.15