找规律,分析让 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
......... 显然循环了
#include <iostream>
using namespace std;
int main()
{
int n;
while(cin>>n){
if(n%==) cout<<"yes"<<endl;
else cout<<"no"<<endl;
}
return ;
}//2016-04-22 22:14:02