Time Limit: 2 sec / Memory Limit: 1024 MB
配点 : 8 点
注意
この問題に対する言及は、2020/12/27 18:00 JST まで禁止されています。言及がなされた場合、賠償が請求される可能性があります。 試験後に総合得点や認定級を公表するのは構いませんが、どの問題が解けたかなどの情報は発信しないようにお願いします。
問題文
16 進法では、一般的に 0123456789ABCDEF
の 16 個の数字を使って 1 つの桁を表しますが、 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ
の 36 個の数字を使う 36 進法を考えます。
36 進法では、0 の次は 1 、 9 の次は \rm A 、\rm Z の次は 10 になります。
整数 N が 10 進表記で与えられるので、 36 進表記に変換してください。
制約
- N は整数
- 0 \le N \lt 36^3
入力
入力は以下の形式で標準入力から与えられる。
N
出力
N を 36 進表記で出力せよ。
入力例 1
123
出力例 1
3F
\rm 123=3\times36^1+15(F)\times36^0 です。
入力例 2
2304
出力例 2
1S0
\rm 2304=1\times36^2+28(S)\times36^1 です。
入力例 3
0
出力例 3
0
Score : 8 points
Warning
Do not make any mention of this problem until December 27, 2020, 6:00 p.m. JST. In case of violation, compensation may be demanded. After the examination, you can reveal your total score and grade to others, but nothing more (for example, which problems you solved).
Problem Statement
In base 16, a digit is represented by one of the 16 symbols: 0123456789ABCDEF
.
Here, let us consider base 36, which uses 36 symbols: 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ
.
In base 36, 0 precedes 1, 9 precedes \rm A, and \rm Z precedes 10.
Given an integer N in base 10, convert it to base 36.
Constraints
- N is an integer.
- 0 \le N \lt 36^3
Input
Input is given from Standard Input in the following format:
N
Output
Print N in base 36.
Sample Input 1
123
Sample Output 1
3F
We have \rm 123=3\times36^1+15(F)\times36^0.
Sample Input 2
2304
Sample Output 2
1S0
We have \rm 2304=1\times36^2+28(S)\times36^1.
Sample Input 3
0
Sample Output 3
0