C++STL stack(スタック)


#include 
#include 
using namespace std;
int main()
{
	stack<int>mstack;
	for (int i = 0; i < 5; i++)
		mstack.push(i);//  
	cout << "size:" << mstack.size() << endl;//    
	while (!mstack.empty())//       
	{
		cout << " " << mstack.top();      
		mstack.pop();  
	}
	cout << endl;
}