顺序表将十进制转换成其他进制教案资料.docVIP

  • 1
  • 0
  • 约1.82千字
  • 约 3页
  • 2020-09-20 发布于浙江
  • 举报

顺序表将十进制转换成其他进制教案资料.doc

#includestdio.h #includestdlib.h #define init_size 100 #define increasesize 10 typedef struct{ int * base; int * top; int stacksize; }SqStack; void CreateStack(SqStack s){ s.base=(int*)malloc(init_size*sizeof(int)); s.top=s.base; s.stacksize=init_size; } void Push(SqStack s,int e){ if(s.top-s.base=s.stacksize) s.base=(int *)realloc(s.base,(s.stacksize+increasesize)*sizeof(int)); *s.top++=e; s.stacksize++; } void Pop(SqStack s,int e){ if(s.base==s.top) { printf(这是空的栈);e=-1;} else { e=*--s.top; s.stacksize--; } } void conversion(int a,int b) { SqStack sc; int e; C

文档评论(0)

1亿VIP精品文档

相关文档