On the 3 distros you use, gcc should be installed...
To use it;
-open up a text editor,
-enter your code
-save with the name test.cpp(of courseit can be of anyother name)
-then invoke this command on a terminal:
gcc test.cpp -o test
This will generate a program named test...