Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApplication
- {
- class Program
- {
- static void Main(string[] args)
- {
- int A = Convert.ToInt32(Console.ReadLine());
- int curValue = 1;
- int count = 0;
- while(curValue <= A)
- {
- count++;
- int prevValue = curValue;
- curValue+= prevValue;
- }
- Console.WriteLine(curValue == A ? count : "-1");
- }
- }
- }
Add Comment
Please, Sign In to add comment