2C. Fibonacci Again
Time Limit: 1000ms
Case Time Limit: 1000ms
Memory Limit: 32768KB
64-bit integer IO format: %I64d Java class name: Main
There are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) + F(n-2) (n>=2). View Code
Input
Input consists of a sequence of lines, each containing an integer n. (n < 1,000,000).
Output
Print the word "yes" if 3 divide evenly into F(n). Print the word "no" if not.
Sample Input
012345
Sample Output
nonoyesnonono 规律是:no no yes no
1 #include2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #define LL long long10 using namespace std;11 int main(){12 int n;13 while(~scanf("%d",&n)){14 n%4 == 2 ? puts("yes"):puts("no");15 }16 return 0;17 }