0
這是我的c代碼,需要從十進制轉換爲基數32。獲取奇怪的符號作爲輸出。需要將小數轉換爲基數32,最新錯誤? base 32 = 0-9 A-V
#include <stdio.h>
char * f(unsigned int num){
static char base[3];
unsigned int mask=1,base32=0;
int i,j;
for (j=0;j<3;j++)
for (i=0;i<5;num<<1,mask<<1){
if (mask&num){
base32 = mask|base32;
base32<<1;
}
if (base32<9)
base[j]=base32+'0';
else
base[j]=(char)(64+base32-9);
}
}
基座32 = 0-9甲-V
int main()
{
unsigned int num =100;
printf("%s\n",f(num));
return 1;
}
should get 34.