Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
381 B
0
Indexable
Never
#include <iostream>

using namespace std;

int main(){
    int n,a1=0, a2=1, a3=1, a4=0,a5=1, b=1;
    cin >> n;
    while(a4<a5){
        a3 =a1 + a2;
        a1 = a2;
        a2 = a3;
        b++;
        if (a3>n){
            cout << 0;
            break;
        }
        if(n==a3){
            cout << 1 << endl<< b;
            break;
        }
    }
}