2018/07/08

[c] Fibonacci

#include 

int main(){
    unsigned long a,b,cnt,i,n1,n2,n;

    scanf("%ld %ld",&a, &b);

    n2=1;
    n1=2;
    cnt=0;

    for(i=3;i=a && n<=b)
        {   
            cnt++;
            printf("cnt %ld : %ld\n", cnt, n );
        }   
        n2 = n1; 
        n1 = n;
    }   

    printf("%ld\n", cnt);
}

댓글 없음:

댓글 쓰기