12611: Hexadecimal conversion problem
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:3
Solved:0
Description
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.
Input
Entered two numbers:N, B.,Run to the end of the file.(0 < = n < = 1000000000,2<=b<=16).
Output
The output n in B decimal representation. Note: if the B input is 16 when add 0X, letters are uppercase form.
Sample Input Copy
10 2
10 16
100 7
1000000000 16
Sample Output Copy
1010
0XA
202
0X3B9ACA00