ACM 1021 Fibonacci Again

来源:互联网 发布:云计算 中国 编辑:程序博客网 时间:2024/06/04 19:36

Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) + F(n-2) (n>=2).
Print the word “yes” if 3 divide evenly into F(n).
Print the word “no” if not.

#include<stdio.h>int main(){    int n;    while(scanf("%d",&n)!=EOF){        if(n%4==2)        printf("yes\n");        else        printf("no\n");    }    return 0;}
原创粉丝点击