问题 2585 --Hexadecimal conversion problem

2585: Hexadecimal conversion problem

时间限制: 1 Sec  内存限制: 128 MB
提交: 76  解决: 35
[提交][状态][讨论版][命题人:]

题目描述

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

来源

 

[提交][状态]