Time Limit: 10 MS Memory Limit: 32768 KB
Total Submission(s): 103 Accepted Submission(s): 38
Description
There are another kind of Fibonacii: F(0) = 7, F(1) = 11, F(n) = F(n-1) + F(n-2) (n>=2)
Input
Input sonsists of a sequence of lines, each containing an interger n. (n<10^20)
Output
Print the word "yes" if 3 divide evenly into F(n).
Print the word "no" if not.
Sample Input
0 1 2 3 4 5
Sample Output
no no yes no no no
Hint
水题
Source
key:
怎么输入n
附上AC代码:
#include<bits/stdc++.h>
using namespace std;
string a;
int x=0,c=0;
int main()
{
while(getline(cin, a))
{
c=a.length();
if(c==1)
x=a[0]-'0';
else
x=(a[c-2]-'0')*10+(a[c-1]-'0');
if(x%4==2)
printf("yes\n");
else
printf("no\n");
}
}