diff options
| author | Connor McDowell <[email protected]> | 2024-02-15 15:48:19 -0800 |
|---|---|---|
| committer | Connor McDowell <[email protected]> | 2024-02-15 15:48:19 -0800 |
| commit | 580c23772ae673d5adc22929f3aed51b0d0e5254 (patch) | |
| tree | 659e68de28ce3429cef476f722467e2f5e38ab88 | |
| parent | 2d array created, values assigned properly, however prints 9 times (diff) | |
| download | in-class-exercise-11-connormcdowell275-main.tar.xz in-class-exercise-11-connormcdowell275-main.zip | |
| -rw-r--r-- | Project1/program.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/Project1/program.cpp b/Project1/program.cpp index c7715dc..c846482 100644 --- a/Project1/program.cpp +++ b/Project1/program.cpp @@ -44,14 +44,23 @@ int printArray(int(&matrix)[ROW][COLUMN]) { { for (auto j = 0u; j < COLUMN; ++j) { - for (auto t = 1; t <= 9; ++t) - { - matrix[i][j] = t; - cout << matrix[i][j] << " "; - } - + //if (i <= 9, j <= 9) + //{ + // int t = 0; + // t + 1; + // matrix[i][j] = t; + // cout << matrix[i][j] << " "; + //} + //int t = 1; + //++t; + //matrix[i][j] = t; + //cout << matrix[i][j] << " "; + matrix[i][j] = i * COLUMN + j + 1; + cout << matrix[i][j] << " "; } + cout << endl; } + return 0; } int main() |