+ 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
3 ответов
+ 3
написано очень сложно. упрости программу
+ 3
некрасивый код
+ 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