+ 1

Why can't this programm get through the test of working ability? Where is a mistake? Please help

it was written to show index of Fibonacci number. If the number you enter is Fibonacci it shows an index of the number if it's not -1 https://code.sololearn.com/c14rvlpPmNG0/?ref=app

10th Jan 2018, 12:05 PM
Yura Tarasov
Yura Tarasov - avatar
3 Respuestas
+ 3
написано очень сложно. упрости программу
14th Jan 2018, 7:35 PM
UraL
+ 3
некрасивый код
14th Jan 2018, 7:36 PM
UraL
+ 3
1. Why do you print 0 if n is 0? 0 is not a Fibonacci number. Your program have to output -1 in this case 2. What if a negative number is entered? И, да, код не очень. Слишком много лишнего, я бы написал как-то так (если не заморачиваться с оптимизацией): https://code.sololearn.com/cM1BAq5GtCoJ/?ref=app
15th Jan 2018, 3:43 PM
LimitWolf
LimitWolf - avatar