Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. using System;
  2.  
  3. class MainClass {
  4. public static void Main (string[] args) {
  5. int r1 = 1, r2 = 1, z, a;
  6. a = int.Parse(Console.ReadLine());
  7. for (int i = 2; ; i++){
  8. if (a >= r1 && r2 > a){
  9. Console.WriteLine(i);
  10. break;
  11. }
  12. z = r2;
  13. r2 += r1;
  14. r1 = z;
  15. }
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement