c++ print stack from top to bottom code example
Example: c++ print stack from top to bottom
void PrintStack(stack<int> s)
{
if (s.empty())
return;
int x = s.top();
s.pop();
cout << x << ' ';
PrintStack(s);
s.push(x);
}