西电复试之——真题2013A 斐波那契数列
F(0)=7;
F(1)=11;
F(n)=F(n-1)+F(n-2);
#include<iostream>
using namespace std;
int F(int n) {
if (n == 0)
return 7;
if (n == 1)
return 11;
return F(n - 1) + F(n - 2);
}
int main() {
int n;
cin >> n;
int m, num;
while (n--) {
cin >> m;
num = F(m);
if (num % 3 == 0)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
return 0;
}