ํฐ์คํ ๋ฆฌ ๋ทฐ
728x90
๋ฐ์ํ
๋ฌธ์
๋ฌธ์ ํ์ด
0 ~ 9์ ์ซ์๊ฐ ๋ฌธ์์ด "ZRO", "ONE", "TWO", "THR", "FOR", "FIV", "SIX", "SVN", "EGT", "NIN"์ ๊ฐ์ด ์ฃผ์ด์ง ๋ ๋ฌธ์์ด ์์ด ์๋ ์ซ์ ์์ผ๋ก ์ ๋ ฌ ํ์ ์ถ๋ ฅํ๋ ๋ฌธ์ ์ด๋ค. ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํด์๋ ๋์ ๋๋ฆฌ๋ฅผ ํ์ฉํ๋ฉด ์ฝ๊ฒ ํ ์ ์๋ค.
์ฝ๋
digit_to_string = {
0: "ZRO",
1: "ONE",
2: "TWO",
3: "THR",
4: "FOR",
5: "FIV",
6: "SIX",
7: "SVN",
8: "EGT",
9: "NIN"
}
string_to_digit = {value: key for key, value in digit_to_string.items()}
test_case = int(input())
for t in range(1, test_case + 1):
# #1 ์ฌ์ด์ฆ๋ ํ์ ์์ผ๋ฏ๋ก input๋ง ๋ฐ์.
input()
digit = sorted([string_to_digit.get(s) for s in input().split()])
string = [digit_to_string.get(d) for d in digit]
print('#' + str(t), *string)
728x90
๋ฐ์ํ
'๐จโ๐ป ์ฝ๋ฉํ ์คํธ > SWEA' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
SWEA: 1234 ๋น๋ฐ๋ฒํธ (0) | 2020.10.07 |
---|---|
SWEA: 1225 ์ํธ์์ฑ๊ธฐ (0) | 2020.10.07 |
SWEA: 1220 Magnetic (0) | 2020.10.07 |
SWEA: 1215 ํ๋ฌธ1 (0) | 2020.10.07 |
SWEA: 1209 Sum (0) | 2020.10.07 |
๋๊ธ
๊ธ ๋ณด๊ดํจ
์ต๊ทผ์ ์ฌ๋ผ์จ ๊ธ
์ต๊ทผ์ ๋ฌ๋ฆฐ ๋๊ธ