From da862e505457ec3ec701f7c41ecdd1061d5d1de4 Mon Sep 17 00:00:00 2001 From: RossTheRoss Date: Tue, 2 Apr 2019 15:54:57 -0500 Subject: AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH --- ee1301/wk5/hw5_directory/strap012_HW5C.cpp | 40 ++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 7 deletions(-) (limited to 'ee1301/wk5/hw5_directory/strap012_HW5C.cpp') diff --git a/ee1301/wk5/hw5_directory/strap012_HW5C.cpp b/ee1301/wk5/hw5_directory/strap012_HW5C.cpp index 9948820..bfd6709 100644 --- a/ee1301/wk5/hw5_directory/strap012_HW5C.cpp +++ b/ee1301/wk5/hw5_directory/strap012_HW5C.cpp @@ -1,11 +1,37 @@ #include +#include +#include using namespace std; -int main(int argc, char *argv[]) -{ - // if (argc != 4) { - // cout << "Invalid input!" << endl << " USAGE: ./rand-array m n max" << endl; - // return 2; - // } - +#define SIZE 100 +int maxRow = 0, maxColumn = 0; +void getInput(int input[SIZE][SIZE]); +int main() { + int column = 0, row = 0; + /* + Array is set up as follows + C + R 0 1 ... + 1 + ... + */ + int inputArray[SIZE][SIZE] = {0}; + getInput(inputArray); + +} + +void getInput(int input[SIZE][SIZE]) { + string test; + while (getline(cin,test)) { + istringstream ss(test); + string temp; + while(getline(ss,temp,' ')) + maxRow=0; + { + input[maxRow][maxColumn] = stoi(temp); + maxRow++; + } + maxColumn++; + } + cout << maxRow << " " << maxColumn << endl; } \ No newline at end of file -- cgit v1.2.3