单点时限: 2.0 sec
内存限制: 512 MB
Write a function itob(n,s,b)
that converts the integer $n$ into a base $b$ character representation in the string $s$ . In particular, itob(n,s,16)
formats $s$ as a hexadecimal integer in $s$.
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 $n$, $b$. ($ 2 \leq b \leq 36 $)
Ouput the string $s$ .
-489968884 18
-E757FBA
900479765 35
H52FIA
7 2
111
-4 3
-11