阿吉 原创
#include <stdio.h>
#include <stdlib.h>int radix = 2;
void myprintfdec(int x)
{
int i,p = 0;
char a;
char s[100];
while(x != 0){
i = x % radix;
itoa(i, &a, radix);
s[p++] = a;
//putchar(a);
x /= radix;
}
while(--p != -1){
putchar(s[p]);
}
return;
}
void main()
{
int i = 0x7;
myprintfdec(i);
return;
}