Skip to content
This repository was archived by the owner on May 27, 2019. It is now read-only.

Commit 7646cc4

Browse files
committed
Fix argument reading
1 parent a03f94f commit 7646cc4

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Program.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,11 @@ void Program::runAlgorithm(char index) {
168168
char arg1;
169169
int arg2;
170170
int arg3;
171-
171+
172172
if (graph->getNumberOfAvailableAlgorithms() > index - 1) {
173173
cout << "Podaj argument 1: ";
174174
cin >> arg1s;
175-
while (arg1s != "l" || arg1s != "L" || arg1s != "m" || arg1s != "M") {
175+
while (arg1s != "m" && arg1s != "M" && arg1s != "l" && arg1s != "L") {
176176
cerr << "Bledna wartosc! Podaj argument 1: ";
177177
cin >> arg1s;
178178
}
@@ -198,7 +198,7 @@ void Program::runAlgorithm(char index) {
198198
cerr << "Bledna wartosc! Podaj argument 3: ";
199199
}
200200

201-
graph->runAlgorithm(index, arg1, arg2, 0);
201+
graph->runAlgorithm(index, arg1, arg2, arg3);
202202
} else {
203203
cerr << "Nie ma takiej opcji, wybierz jeszcze raz." << endl;
204204
}

0 commit comments

Comments
 (0)