zoukankan      html  css  js  c++  java
  • hdu1021

    #include <stdio.h>

    int fib(int m)
    {
    int n_2=1,n_1=2,n,i;
    if(m==0)return 1;
    if(m==1)return 2;
    for(i=2;i<=m;i++)
    {
    n=(n_2+n_1)%3;
    n_2=n_1;
    n_1=n;
    }
    return n;
    }

    int main(void)
    {
    int n;
    while(scanf("%d",&n)!=EOF)
    {
    printf("%s ",fib(n)?"no":"yes");
    }
    return 0;
    }

  • 相关阅读:
    01
    商城管理系统
    10
    09
    08
    07(3)
    07(2)
    07
    06
    jsp第一次作业
  • 原文地址:https://www.cnblogs.com/wangkun1993/p/6275687.html
Copyright © 2011-2022 走看看