// Filename : Stack.c
// Author : LupingChen
// Date : 2015.5.27
// Content : main
#include <stdio.h>
#include <stdlib.h>
//....
//前面三遍可查询
int main(void)
{
//创建
Stack* ps = create(6);
printf("%s\n", empty(ps)?"栈空了":"栈没空");
printf("%s\n", full(ps)?"栈满了":"栈没满");
pirntf("-------------------------------------------\n");
//入栈
for (i =1, i <7, i++)
{
push(ps, i*10 + i);
}
travel(ps); //11 22 33 ....
printf("出栈元素值是:%d", pop(ps));
travel(ps);
printf("出栈元素值", pos(ps));
travel(ps);
printf("栈顶元素值:%d", peek(ps));
printf("栈中元素个数:%d", size(ps));
//销毁堆栈变量
destroy(ps);
return 0;
}
//...
//前面三编可查询