2020 - 小时候可喜欢斐波那契了
已知斐波那契数列的前几项F[0]=1,F[1]=1.F[2]=2 ... F[n]=F[n-1]+F[n-2]
有一天B哥想欺负pikachu ,它跑过来问:“pikachu,你知道不知道斐波那契数列中第几项能整除我的幸运数字?”
Pikachu :“你的幸运数字不会是B吧。。。。”
B哥:“你猜对了 (⊙o⊙)… ”
....
好吧,问题来了,判断斐波那契第n项能不能被B哥的幸运数字(13) 整除。
Input
输入T,表示有T组数据。
下面T行,每行输入n 。(1<=n<=60)
Output
如果斐波那契第n项能整除B哥的幸运数字,输出“Yes”
不然输出“No”
Examples
Input
5 2 4 6 8 10
Output
No No Yes No No
Solution C++
#include <iostream> #include <cstdio> using namespace std; int main() { int T; scanf("%d",&T); while(T--) { int n; scanf("%d",&n); if(n%7==6) printf("Yes\n"); else printf("No\n"); } return 0; }