#include "stdafx.h"
#include <iostream>
#include <stack>
#include "Windows.h"
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
stack<int> nMyStack;//
int i = 0;
cout << "入栈。。。" << endl;
cout <<"----------------------------------------------------------------/n";
for(i = 0; i < 10; i++)
{
cout << i << "入栈/t";
nMyStack.push(i);
cout<< "当前栈顶元素" << nMyStack.top() << "/t元素个数" << nMyStack.size() << endl;
}
cout << "/n出栈。。。" << endl;
cout << "----------------------------------------------------------------/n";
while(!nMyStack.empty())
{
cout << nMyStack.top() << "出栈/t";
nMyStack.pop();
}
if(nMyStack.empty())
{
cout<<"栈已为空!";
}
return 0;
}