题面
Write a function itob(n,s,b)
that converts the integer into a base character representation in the string . In particular, itob(n,s,16)
formats as a hexadecimal integer in .
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 , . ()
输出格式
Ouput the string .
样例
输入
-489968884 18
输出
-E757FBA
输入
900479765 35
输出
H52FIA
输入
7 2
输出
111
输入
-4 3
输出
-11