Skip to content

Commit 000627b

Browse files
committed
[Silver V] Title: 소트인사이드, Time: 96 ms, Memory: 9336 KB -BaekjoonHub
1 parent 9aab50e commit 000627b

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# [Silver V] 소트인사이드 - 1427
2+
3+
[문제 링크](https://www.acmicpc.net/problem/1427)
4+
5+
### 성능 요약
6+
7+
메모리: 9336 KB, 시간: 96 ms
8+
9+
### 분류
10+
11+
문자열, 정렬
12+
13+
### 제출 일자
14+
15+
2026년 4월 27일 20:57:43
16+
17+
### 문제 설명
18+
19+
<p>배열을 정렬하는 것은 쉽다. 수가 주어지면, 그 수의 각 자리수를 내림차순으로 정렬해보자.</p>
20+
21+
### 입력
22+
23+
<p>첫째 줄에 정렬하려고 하는 수 N이 주어진다. N은 1,000,000,000보다 작거나 같은 자연수이다.</p>
24+
25+
### 출력
26+
27+
<p>첫째 줄에 자리수를 내림차순으로 정렬한 수를 출력한다.</p>
28+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"use strict";
2+
3+
const fs = require("fs");
4+
5+
const input = fs
6+
.readFileSync(process.platform === "linux" ? "/dev/stdin" : "./input.txt")
7+
.toString()
8+
.trim()
9+
.split("\n");
10+
11+
const N = input[0]
12+
.split("")
13+
.map(Number)
14+
.sort((a, b) => b - a);
15+
16+
console.log(N.join(""));

0 commit comments

Comments
 (0)