Hangzhou Electric 1021 even to AC! Gangster seeking answers to how this is going to come in

Here Insert Picture Description
Is it coincidence? I do this is just the beginning modulo 9, but not through, and finally into a direct AC 8

#include <iostream>
using namespace std;
int main(){
	int f[10];
	int n;
	while(cin>>n){
	f[0]=7%3;
    f[1]=11%3;
	for(int i=2;i<9;i++){
	 f[i]=(f[i-1]+f[i-2])%3;
	}
   if(f[n%8]==0)
     cout<<"yes"<<endl;
     else
     cout<<"no"<<endl;
	}
	
	return 0;
}
Published 44 original articles · won praise 0 · Views 624

Guess you like

Origin blog.csdn.net/weixin_45191675/article/details/105170682