/*************************************************
pslyjvm工作室
Copyright 2010 pslyjvm's
All rights Reserved
作者:pslyjvm
功能:对输入的任何一个非负10进制数,打印输出其8进制数
*************************************************/
#include<stdio.h>
#include<malloc.h>
typedef int Status; //对栈操作函数返回值进行重定义
typedef int SElemType;//对栈内元素类型进行重定义
#include"stack.h" //调用栈头文件(把stack.h头文件和本文件放到统一个文件目录下)
void conversion(){
//转化函数
int a,e;
SqStack s;
printf("请输入您要转化的数:");
scanf("%d",&a);
InitStack(&s);
while(a){
Push(&s,a%8);
a=a/8;
}
while(!StackEmpty(s)){
Pop(&s,&e);
printf("%d",e);
}
printf("/n");
}
void main(){
conversion();
}