问答题
编写一个类,实现简单的栈(提示:用链表结构实现)。数据的操作按先进后出(FILO)的顺序。 提示: 成员函数为 void queue::put(int item); //将数据item插入到栈中 int queue::get(); //从栈中取数据 数据成员为 一个指向链首的指针 链表结构为 struct Node { int a; Node* next; } 对象使用过程 queue que;
答案:
根据您的要求,下面是一个简单的栈实现,使用链表结构:```cpp#include // 定义链表节点...