void scale1(int scanfNum){
int i=0;
int newNums[64];
while (scanfNum>0) {
newNums[i++]=scanfNum%2;
scanfNum /= 2;
}
printf("十進(jìn)制轉(zhuǎn)二進(jìn)制數(shù)據(jù)為:0x");
for(i=i-1;i>=0;i--){
printf("%d",newNums[i]);
};
}
·········································································································································
void scale2(int scanfNum){
char nums[]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
int newNums[100];
int i=0;
int n = 0;
while (scanfNum>0) {
newNums[i++] = scanfNum%16;
scanfNum/=16;
}
printf("十進(jìn)制轉(zhuǎn)十六進(jìn)制數(shù)據(jù)為:0x");
for (i=i-1; i>=0; i--) {
n =newNums[i];
printf("%c",nums[n]);
}
}