0

I solve an euclidus algorythm, that explain in book of D. Knut. I beginer in c++, and try to understand, what is wrong. T

Give me advice, pls) https://code.sololearn.com/cKu74XGSu75U/?ref=app

29th Dec 2018, 10:46 AM
Сергей Климов
Сергей Климов - avatar
2 odpowiedzi
+ 2
The problem is r. It is set in this line: if (m < n){r = m; m = n; n = r; r = 1;} But what happens if m >= n. r will have no value.
2nd Jan 2019, 11:49 AM
Paul
Paul - avatar
0
No, if m >= n we already found solve. "if" skip by program
22nd Jan 2019, 8:05 PM
Сергей Климов
Сергей Климов - avatar