📄 testprogstack.cpp
字号:
//Program to test the various operations of a stack
#include <iostream>
#include "myStack.h"
using namespace std;
int main()
{
stackType<int> intStack(50);
stackType<int> tempStack;
intStack.push(23);
intStack.push(45);
intStack.push(38);
tempStack = intStack; //copy intStack into copyStack
cout<<"tempStack elements: ";
while(!tempStack.isEmptyStack()) //print copyStack
{
cout<<tempStack.top()<<" ";
tempStack.pop();
}
cout<<endl;
cout<<"The top element of intStack: "<<intStack.top()<<endl;
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -