aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConnor McDowell <[email protected]>2024-02-15 15:48:19 -0800
committerConnor McDowell <[email protected]>2024-02-15 15:48:19 -0800
commit580c23772ae673d5adc22929f3aed51b0d0e5254 (patch)
tree659e68de28ce3429cef476f722467e2f5e38ab88
parent2d array created, values assigned properly, however prints 9 times (diff)
downloadin-class-exercise-11-connormcdowell275-main.tar.xz
in-class-exercise-11-connormcdowell275-main.zip
completedHEADmain
-rw-r--r--Project1/program.cpp21
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()