#include #include using namespace std; int main() { const int nrows {100}; //number of rows of pixels const int ncols {100}; //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 (row < 10) { cout << "199 21 133\n"; //upper half is mediumvioletred } else if (row < 20) { cout << "255 20 147\n"; //lower half is deeppink } else if (row < 30) { cout << "219 112 147\n"; //lower half is palevioletred } else if (row < 40) { cout << "255 205 180\n"; //lower half is hotpink } else if (row < 50) { cout << "255 192 203\n"; //lower half is pink } else if (row < 60) { cout << "240 138 128\n"; //lower half is lightcoral } else if (row < 70) { cout << "233 150 122\n"; //lower half is darksalmon } else if (row < 80) { cout << "250 128 114\n"; //lower half is salmon } else if (row < 90) { cout << "255 160 122\n"; //lower half is lightsalmon } else { cout << "255 192 203\n"; //lower half is lightpink } } } return EXIT_SUCCESS; }