【正确答案】算法实现如下:
#include"stdio.h"
#include"seqstack.h"
void d_to_o(unsigned x)
{ SEQSTACK stack,*s;
s=&stack;
Init_Stack(s);
while(x!=0)
{ push_Stack(s,x/%8);
x=x/8;
}
while(!Stack_Empty(s))
{printf("/%4d",Gettop_Stack(s));
pop_Stack(s);
}
}
main()
{ unsigned x=150;
d_to_o(x);
}
【答案解析】