102710: [AtCoder]ABC271 A - 484558
Description
Score : $100$ points
Problem Statement
In the hexadecimal system, where the digits ABCDEF
corresponding to $10,11,12,13,14$, and $15$ are used in addition to 0123456789
, every integer between $0$ and $255$ is represented as a $1$- or $2$-digit numeral.
For example, $0$ and $12$ are represented as $1$-digit hexadecimal numerals 0
and C
; $99$ and $255$ are represented as $2$-digit hexadecimals 63
and FF
.
Given an integer $N$ between $0$ and $255$, convert it to an exactly two-digit hexadecimal numeral, prepending leading 0
s if necessary.
Notes
The judge is case-sensitive. Specifically, you cannot use abcdef
as hexadecimal digits instead of ABCDEF
.
Constraints
- $0 \leq N \leq 255$
- $N$ is an integer.
Input
The input is given from Standard Input in the following format:
$N$
Output
Print the answer.
Sample Input 1
99
Sample Output 1
63
$99$ is represented as 63
in hexadecimal.
Sample Input 2
12
Sample Output 2
0C
$12$ is represented as C
in hexadecimal.
Since we ask you to convert it to a two-digit hexadecimal numeral, the answer is 0C
, where 0
is prepended to C
.
Sample Input 3
0
Sample Output 3
00
Sample Input 4
255
Sample Output 4
FF
Input
题意翻译
将十进制整数 $N$ 转换为十六进制。 $0 \le N \le 255$Output
问题描述
在十六进制系统中,除了使用0123456789
外,还使用了代表$10,11,12,13,14$和$15$的字母ABCDEF
,将$0$到$255$之间的每个整数表示为一位或两位数。
例如,$0$和$12$分别表示为一位十六进制数0
和C
;$99$和$255$分别表示为两位十六进制数63
和FF
。
给定一个在$0$到$255$之间的整数$N$,将其转换为恰好两位的十六进制数,如有需要,请在前面补零。
注意
法官对大小写敏感。具体来说,您不能使用abcdef
作为十六进制数而不是ABCDEF
。
约束
- $0 \leq N \leq 255$
- $N$是一个整数。
输入
输入通过标准输入给出以下格式:
$N$
输出
打印答案。
样例输入1
99
样例输出1
63
$99$在十六进制中表示为63
。
样例输入2
12
样例输出2
0C
$12$在十六进制中表示为C
。
由于我们要求将其转换为两位十六进制数,答案为0C
,其中在C
前面添加了0
。
样例输入3
0
样例输出3
00
样例输入4
255
样例输出4
FF