#include #include using namespace std; int main() { const int nrows {300}; const int ncols {450}; const int stripewidth {30}; cout << "P3\n" << ncols << " " << nrows << "\n" << 255 << "\n"; for (int row {0}; row < nrows; ++row) { for (int col {0}; col < ncols; ++col) { int diagonal {(row + col) / stripewidth}; if (diagonal % 2 == 0) { cout << "0 0 0\n"; } else { cout << "255 255 255\n"; } } } return EXIT_SUCCESS; }