Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class MainClass {
- public static void Main (string[] args) {
- int r1 = 1, r2 = 1, z, a;
- a = int.Parse(Console.ReadLine());
- for (int i = 2; ; i++){
- if (a >= r1 && r2 > a){
- Console.WriteLine(i);
- break;
- }
- z = r2;
- r2 += r1;
- r1 = z;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement