结论:斐波纳契数 f(n),n能被4整除,f(n)能被3整除
n能被6整除,f(n)能被4整除,有数论知识得,n能被12整除,f(n)能被12整除。
代码:
#include <iostream>
using namespace std;
int main()
{
int n;
while(cin>>n)
{
if(n%12==0)
{
cout<<"YES"<<endl;
}
else if(n%4==0)
{
cout<<"3"<<endl;
}
else if(n%3==0)
{
cout<<"4"<<endl;
}
else
cout<<"NO"<<endl;
}
return 0;
}