📄 main.cpp
字号:
#include <iostream>
#include "stack.h"
using namespace std;
int main()
{
Stackcopy numbers;
int n,item;
cout<<"input the size of numbers:";
cin>>n;
cout<<endl;
cout<<"input the numbers:";
for(int i=0;i<n;i++){
cin>>item;
numbers.push(item);
}
cout<<endl;
cout<<"if the stack is full,return '1',else return '0':"<<numbers.full()<<endl<<endl;
cout<<"the size of the stack is:"<<numbers.size()<<endl<<endl;
cout<<"the reversing numbers will be:";
while (!numbers.empty()) {
// numbers.top(item);
cout <<number.top()<< " ";
numbers.pop();
}
cout<<endl<<endl;
numbers.clear();
cout<<"after clear,the size of the stack is:"<<numbers.size()<<endl<<endl;
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -