一,栈 栈类似于弹匣,先进后出。 实现方法:动态顺序表 Stack.h 文件: 源码: #pragma once #include<stdlib.h> #include<iostream> using namespace std; typedef int type; struct Stack { type* arr; int top; int capacity; }; typedef struct Stack ST; // 初始化栈 void StackInit(ST* ps); // 入栈 void StackPush(ST* ps, type data); // 出栈 void StackPop(ST* ps); // 获取栈顶元素 type StackTop(ST* ps); // 获取栈中有效元素个数 int StackSize(ST* ps); // 检测栈是否为空,如果为空返回非零结果,如果不为空返回0 int StackEmpty(ST* ps); // 销毁栈 void StackDestroy(ST* ps); void menu(); 实现文件 St.cpp...