十进制N和其他d进制
N=(N div d)Xd+N mod d (其中:div为整除运算,mod为求余运算)
void conversion(){
SqStack S;
int N;
SElemType e;
Init_Stack(S);
scanf("%d",&N);
while(N){
Push(S,N%8);
N=N/8;
}
while(!Stack_Empty(S)){
Pop(S,e);
printf("%d",e);
}
Destroy_Stack(S);
printf("\n");
}
欢迎留言交流。。。