Build and run C++

Hello,

How can i compile and run one of the examples in C++ from the Ubuntu terminal?