diff options
author | RossTheRoss <msattr@gmail.com> | 2019-04-04 18:57:21 -0500 |
---|---|---|
committer | RossTheRoss <msattr@gmail.com> | 2019-04-04 18:57:21 -0500 |
commit | c6ece1220be62a09b342bb5e568e46b5013f4221 (patch) | |
tree | 5a35ba467141711870e77d56684cfa5682fd25bd /ee1301/wk5/hw5_directory | |
parent | PUT maze in (diff) | |
download | homework-c6ece1220be62a09b342bb5e568e46b5013f4221.tar homework-c6ece1220be62a09b342bb5e568e46b5013f4221.tar.gz homework-c6ece1220be62a09b342bb5e568e46b5013f4221.tar.bz2 homework-c6ece1220be62a09b342bb5e568e46b5013f4221.tar.lz homework-c6ece1220be62a09b342bb5e568e46b5013f4221.tar.xz homework-c6ece1220be62a09b342bb5e568e46b5013f4221.tar.zst homework-c6ece1220be62a09b342bb5e568e46b5013f4221.zip |
Fix oopsie
Diffstat (limited to '')
-rw-r--r-- | ee1301/wk5/hw5_directory/strap012_HW5C.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ee1301/wk5/hw5_directory/strap012_HW5C.cpp b/ee1301/wk5/hw5_directory/strap012_HW5C.cpp index 1b1d10d..bc42aa7 100644 --- a/ee1301/wk5/hw5_directory/strap012_HW5C.cpp +++ b/ee1301/wk5/hw5_directory/strap012_HW5C.cpp @@ -35,15 +35,15 @@ int main() { void getInput(int input[SIZE][SIZE]) { string test, temp1; int temp2=0; //I would mainly like to thank whatever user on StackOverflow solved my problem - while (getline(cin,test)) { - temp2 = -2; + while (getline(cin,test,'\n')) { + temp2 = -1; istringstream ss(test); while(getline(ss,temp1,' ')) { temp2++; input[maxRow][temp2] = stoi(temp1); } if (temp2>maxColumn) { - maxColumn = temp2+2; //2 is added to make the math work. + maxColumn = temp2+1; //1 is added to make the math work. } maxRow++; } |