{
Int value [10];
Public:
int pos
Boolean pique (int& value);
Bool push(int value);
Boolean popularity (int& value);
Invalid reset ()
{
pos = 0;
}
Stack ()
{
pos = 0;
}
}
Bool stack: peek (int&; Value)
{
If (position ==0)
{
Returns false
}
Value = value [pos-1];
retuan true
}
Boolean stack: push(int value)
{
if(pos== 10)
{
Returns false
}
values[pos++]= value;
Return true
}
Bool stack: pop(int & amp; Value)
{
If (position ==0)
{
Returns false
}
Value = value [-position];
retuan true
void main()
{
Int value;
Stack stack;
stack . push( 12);
if(stack.peek(value))
Printf("%d ",value);
if(stack.pop(value))
Printf("%d ",value);
}
It's written by mobile phone, which is enough for you to solve the problem.