aboutsummaryrefslogtreecommitdiffstats
path: root/ee1301
diff options
context:
space:
mode:
authorRossTheRoss <msattr@gmail.com>2019-04-04 18:57:21 -0500
committerRossTheRoss <msattr@gmail.com>2019-04-04 18:57:21 -0500
commitc6ece1220be62a09b342bb5e568e46b5013f4221 (patch)
tree5a35ba467141711870e77d56684cfa5682fd25bd /ee1301
parentPUT maze in (diff)
downloadhomework-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.cpp6
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++;
}