#include #include using namespace std; int main() { int nrows {20}; //number of rows of pixels int ncols {30}; //number of columns of pixels cout << "P3\n" << ncols << " " << nrows << "\n" << 255 << "\n"; for (int row {0}; row < nrows; ++row) { for (int col {0}; col < ncols; ++col) { if (col < 10) { cout << "0 99 65\n"; //left third is blue } else if (col < 20) { cout << "255 255 255\n"; //middle third is white } else { cout << "200 16 46\n"; //right third is red } } } return EXIT_SUCCESS; }