#1572. Hexadecimal conversion problem
Hexadecimal conversion problem
说明
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