hdu 1021 Fibonacci Again 递推数列模周期

题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1021

说明 :题目很水 
但是有一个重要结论,只要是递推数列,一定是模周期数列 (可以用抽屉原理证明)

#include<iostream>
using namespace std;
int main()
{
   int n;
   while(cin>>n)
   {
      if(n%8==2||n%8==6)  cout<<"yes"<<endl;
      else cout<<"no"<<endl;
   }
}

posted on 2013-07-09 17:13  814jingqi的ACM  阅读(124)  评论(0编辑  收藏  举报