i would like to know if theres a way i can compile simple cpp programs that contain

Code:
#include <iostream>		// supports cin, cout
#include <iomanip>      // output formatting
#include <cstdlib>		// supports random number
#include <ctime>		// support time
like i would on my mac to run in command line?