From dd41a64838e2b8d8cecef9d8a278e1ce58f274ee Mon Sep 17 00:00:00 2001 From: RossTheRoss Date: Tue, 2 Apr 2019 21:43:08 -0500 Subject: Do more work --- ee1301/wk5/hw5_directory/strap012_HW5B.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'ee1301/wk5/hw5_directory/strap012_HW5B.cpp') diff --git a/ee1301/wk5/hw5_directory/strap012_HW5B.cpp b/ee1301/wk5/hw5_directory/strap012_HW5B.cpp index ca6d150..8508283 100644 --- a/ee1301/wk5/hw5_directory/strap012_HW5B.cpp +++ b/ee1301/wk5/hw5_directory/strap012_HW5B.cpp @@ -1,4 +1,5 @@ #include +#include #include using namespace std; @@ -22,9 +23,9 @@ int main(int argc, char *argv[]) for (int curCol = 0; curCol < n; curCol++) { if (rand() % 2 + 1 == 2) { //Decide the sign of the number - randArray[curRow][curCol] = -1 * (rand() % (max+1)); + randArray[curCol][curRow] = -1 * (rand() % (max+1)); } else { - randArray[curRow][curCol] = (rand() % (max+1)); + randArray[curCol][curRow] = (rand() % (max+1)); } } } @@ -34,7 +35,7 @@ int main(int argc, char *argv[]) { for (int curCol = 0; curCol < n; curCol++) { - cout << randArray[curRow][curCol] << " "; + cout << randArray[curCol][curRow] << " "; } cout << endl; } -- cgit v1.2.3