int main(){
	Stack.push(5);
	Stack.push(2);
	Stack.push(3);
	Stack.push(7);
	Stack.pop();
	Stack.pop();
	Stack.pop();
	Stack.push(10);
	cout << Stack.top() << endl;
	system("pause");
	return 0;
	
}
int main() {
    SetOfStacks test;
    for(int i=1; i<=3*MAX; ++i) test.push(i);
    for (int i=0; i<MAX; ++i) {
        test.popAt(0);
        test.popAt(1);
    }
    test.popAt(3);
    while (!test.isEmpty()) {
        cout<<test.top()<<endl;
        test.pop();
    }
}
Exemple #3
0
int main()
{
    SetOfStacks mystack;
    for(int i=0;i<31;i++)
        mystack.push(i);
    mystack.PopAt(1);
    while(!mystack.isempty())
    {
        cout<<mystack.findtop()<<endl;
        mystack.pop();
    }
    return 0;
}
Exemple #4
0
int main()
{
	SetOfStacks stacks;
	for(int i = 0; i < 10; i++)
	{
		cout<<"SetOfStacks.push("<<i<<");"<<endl;
		stacks.push(i);
	}
	while(!stacks.empty())
	{
		cout<<"SetOfStacks.pop() = "<<stacks.pop()<< ";"<<endl;
	}

	for(int i = 0; i < 10; i++)
	{
		cout<<"SetOfStacks.push("<<i<<");"<<endl;
		stacks.push(i);
	}
	while(!stacks.empty())
	{
		cout<<"SetOfStacks.popAt(" <<0 <<") = "<< stacks.popAt(0)<< ";"<<endl;
	}
	getchar();
}
int main()
{
	SetOfStacks<int> myStackSet;
	myStackSet.push(3);
	myStackSet.push(4);
	myStackSet.push(5);
	cout<<myStackSet.getStackNum()<<endl;
	myStackSet.push(6);
	myStackSet.push(8);
	myStackSet.push(9);
	cout<<myStackSet.getStackNum()<<endl;
	myStackSet.push(0);
	cout<<myStackSet.getStackNum()<<endl;
	myStackSet.pop();
	cout<<myStackSet.getStackNum()<<endl;
	myStackSet.pop();
	myStackSet.pop();
	myStackSet.pop();
	myStackSet.pop();
	myStackSet.pop();
	cout<<myStackSet.getStackNum()<<endl;
	myStackSet.pop();
	return 0;
}