#include<stdio.h>
int main()
{
int x,i;
int a=2, b=0, c=0;
scanf("%d", &x);
if (x > 1)
{
for (i = 1; c < x; i++)
{
c = a + b;
b = a;
a = c;
}
printf("%d", i+1);
}
else
printf("1");
return 0;
}
原文地址:https://blog.51cto.com/14737345/2479855
时间: 2024-11-08 22:15:45