6835: Hexadecimal conversion problem
内存限制:128 MB
时间限制:1.000 S
评测方式:文本比较
命题人:
提交:3
解决:3
题目描述
As we all know, is stored in binary computer! But in real life, we have encountered a variety of system conditions,
We have the most contact is the decimal, however, there arevarious count situations in life. For example: seven days a week,
7 hexadecimal twelve months a year, is 12 hexadecimal etc.. Xiao Ming has recently learned C language, familiar with theconversion of various M-ary C language, so we try varioushexadecimal conversion process, and now he wants to write a program, is to put an unsigned number n, into said in B systemunder the. For example:
N 10, B 2, is transformed into 1010. Another example: n 10, B 16,is converted to 0xA.
输入
Entered two numbers:N, B.,Run to the end of the file.(0 < = n < = 1000000000,2<=b<=16).
输出
The output n in B decimal representation. Note: if the B input is 16 when add 0X, letters are uppercase form.
样例输入 复制
10 2
10 16
100 7
1000000000 16
样例输出 复制
1010
0XA
202
0X3B9ACA00