#include #include using namespace std; //Flag of Ukraine. //Run it like this: ./a.out | /usr/bin/pnmtopng > ukraine.png // ls -l // file ukraine.png // cp ukraine.png public_html int main() { int nrows {60}; //number of rows of pixels int ncols {90}; //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 < 20) { cout << "255 255 0\n"; } else if (row < 40) { cout << "0 0 255\n"; //upper half is blue } else { cout << "255 0 0\n"; //lower half is yellow } } } return EXIT_SUCCESS; }