Commit 8b01b4bd authored by Karine's avatar Karine

exercise_06_42, version3

parent 8e9947c1
......@@ -33,7 +33,6 @@ main()
std::cout << "Enter the numbers for start, end pegs (from 1 to 3): ";
std::cin >> start >> end;
int temp = 6 - (start + end);
if (start == end) {
std::cerr << "Error 2: Numbers for start and end pegs can't be the same." << std::endl;
return 2;
......@@ -43,6 +42,8 @@ main()
return 3;
}
const int temp = 6 - (start + end);
hanoi(count, start, temp, end);
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment