#include #include using namespace std; /* Output these 10 lines: XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX The variable "row" starts at 0 because it is the number of spaces on each line. The variable "col" starts at 0, to agree with "row". */ int main() { int nrows {10}; int ncols {20}; for (int row {0}; row < nrows; ++row) { //Output the spaces (if any) in front of the line. for (int spaces {0}; spaces < row; ++spaces) { cout << " "; } //Output the line itself. for (int col {0}; col < ncols; ++col) { cout << "X"; } cout << "\n"; } return EXIT_SUCCESS; }