Basic stack implementation in c++

#include <iostream>
#include <stack>

int main() {
    std::stack<int> mystack;

    // Pushing elements onto the stack
    mystack.push(10);
    mystack.push(20);
    mystack.push(30);

    // Displaying the top element of the stack
    std::cout << "Top element: " << mystack.top() << std::endl;

    // Popping the top element from the stack
    mystack.pop();

    // Checking if the stack is empty
    if (mystack.empty()) {
        std::cout << "Stack is empty." << std::endl;
    } else {
        std::cout << "Stack is not empty." << std::endl;
    }

    // Displaying the size of the stack
    std::cout << "Size of stack: " << mystack.size() << std::endl;

    return 0;
}