HDU 1021

找规律,分析让 F[N] 每一项对 3 取余的余数:

1,2,0,

2,2,1,0,

1,1,2,0,

2,2,1,0,

1,1,2,0,

2,2,1,0

......... 显然循环了

 1     #include <iostream>  
 2     using namespace std;  
 3     int main()  
 4     {  
 5         int n;  
 6         while(cin>>n){  
 7             if(n%4==2) cout<<"yes"<<endl;  
 8             else cout<<"no"<<endl;  
 9         }  
10         return 0;  
11     }//2016-04-22 22:14:02
我自倾杯,君且随意
原文地址:https://www.cnblogs.com/nicetomeetu/p/5423016.html