已知栈的基本操作函数:intInitStack(SqStack*S);//构造空栈intStackEmpty(SqStack*S);//判断栈空intPush(SqStack*S,ElemTypee);//入栈intPop(SqStack*S,ElemType*e);//出栈函数conversion实现十进制数转换为八进制数,请将函数补充完整。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)
答案解析:有
![](/editor/images/201705/qrcode_for_gh_573e2a458573_258.jpg)
微信扫一扫手机做题