填空題

已知棧的基本操作函數(shù):intInitStack(SqStack*S);//構造空棧intStackEmpty(SqStack*S);//判斷??読ntPush(SqStack*S,ElemTypee);//入棧intPop(SqStack*S,ElemType*e);//出棧函數(shù)conversion實現(xiàn)十進制數(shù)轉換為八進制數(shù),請將函數(shù)補充完整。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)
微信掃碼免費搜題