#include<bits/stdc++.h>
using namespace std;
int main(){
    stack<int> s;
    s.push(1);
    s.push(2);
    s.push(3);
    s.push(4);
    s.push(5);
    cout<<s.top()<<"\n";
    if(s.empty())
    cout<<"Empty stack\n";
    else
    cout<<"Not an empty stack\n";
    cout<<s.size()<<"\n";
    return 0;
}

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: