4477. itob

Naive函数字符串

时间限制:2000 ms

内存限制:512 MiB

题面

Write a function itob(n,s,b) that converts the integer nn into a base bb character representation in the string ss . In particular, itob(n,s,16) formats ss as a hexadecimal integer in ss.

Write a program to call the function.

/***************************************************************/
/*                                                             */
/*  DON'T MODIFY main function ANYWAY!                         */
/*                                                             */
/***************************************************************/


#include <stdio.h>

void itob(int n,char s[100],int b)
{
    // TODO: your function definition

}

int main()
{
    int n,b;
    char s[100];
    scanf("%d%d",&n,&b);
    itob(n,s,b);
    printf("%s\n",s);
    return 0;
}

输入格式

Input nn, bb. (2b362 \leq b \leq 36)

输出格式

Ouput the string ss .

样例

输入

-489968884 18

输出

-E757FBA

输入

900479765 35

输出

H52FIA

输入

7 2

输出

111

输入

-4 3

输出

-11