填空題

已知棧的基本操作函數(shù):intInitStack(SqStack*S);//構(gòu)造空棧intStackEmpty(SqStack*S);//判斷??読ntPush(SqStack*S,ElemTypee);//入棧intPop(SqStack*S,ElemType*e);//出棧函數(shù)conversion實(shí)現(xiàn)十進(jìn)制數(shù)轉(zhuǎn)換為八進(jìn)制數(shù),請將函數(shù)補(bǔ)充完整。voidconversion(){InitStack(S);scanf(“%d”,&N);while(N){(1);N=N/8;}while((2)){Pop(S,&e);printf(“%d”,e);}}//conversion

答案: (1)Push(S,N%8) (2)!StackEmpty(S)
微信掃碼免費(fèi)搜題