Professional Documents
Culture Documents
#include <conio.h>
#include <set>
#include <string>
#include <algorithm>
#include <map>
#include <hash_map>
#include <hash_set>
#include <assert.h>
#include <stack>
int main()
{
stack<int> S;
S.push(8);
S.push(7);
S.push(4);
if (!S.empty())
{
cout << "Not an empty stack...\n";
}
if(S.size() == 3)
cout << "size is 3\n";
assert(S.top() == 4);
S.pop();
assert(S.top() == 7);
S.pop();
assert(S.top() == 8);
S.pop();
if (S.empty())
cout << "now it is empty\n";
_getch();
return 0;
}