fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3. long long a[100],n;
  4. int main() {
  5. cin >> n;
  6. a[1]=2;
  7. a[2]=3;
  8. for(int i=3;i<=100;i++){
  9. a[i]=a[i-1]+a[i-2];
  10. }
  11. int i=1;
  12. while(a[i+1]<=n) i++;
  13. cout<<i;
  14. return 0;
  15. }
Success #stdin #stdout 0s 3464KB
stdin
10
stdout
4