数组和集合

#include <iostream>
#include <stack>
using namespace std;

stack<int> intStack;
intStack.push(1);
intStack.push(3);
intStack.push(5);

int top = intStack.top();
//top is 5
int first = intStack.top();
//first is 5
intStack.pop();
int second = intStack.top();
//second is 3
intStack.pop();
int third = intStack.top();
//third is 1

cout << "top is " << top << endl;
cout << "first is " << first << endl;
cout << "second is " << second << endl;
cout << "third is " << third;