STL Samples : <stack>
スタック
stack

#include <iostream>
#include <stack>
using namespace std;
void std_stack() {
cout << "stack" << endl;
stack<int> stk;
cout << "push... ";
for ( int i = 0; i < 5; i++ ) {
stk.push(i);
cout << i << ' ';
}
cout << endl << "pop... ";
while ( !stk.empty() ) {
cout << stk.top() << ' ';
stk.pop();
}
cout << endl;
}
This entry was posted
on Thursday, March 30th, 2006 at 3:26 pm and is filed under reference.
You can follow any responses to this entry through the RSS 2.0 feed.
Responses are currently closed, but you can trackback from your own site.