给出新的数列: another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) + F(n-2) (n>=2)
第n个斐波那契数列是否能被3整除...
找规律问题,找出规律后发现8个行程循环,第三个和第七个可以被三整除
1 #include <stdio.h>
2 int main()
3 {
4 int n;
5 while(scanf("%d",&n)!=EOF)
6 if((n+1)%8==3||(n+1)%8==7)printf("yes\n");
7 else printf("no\n");
8 return 0;
9 }