#include <cstdio> #include <algorithm> int t,n,a,b,c=1,i,f[50],x,y,g; int main(){ while(c<=1e+9) f[i++]=c=(a=b)+(b=c); scanf("%d",&t); for(x=0;x<t;++x){ scanf("%d",&n); g=0; for(y=0;y<i;++y) if (n%f[y]==0&&std::binary_search(f,f+i,n/f[y])) g=1; puts(g?"TAK":"NIE"); } return 0; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | #include <cstdio> #include <algorithm> int t,n,a,b,c=1,i,f[50],x,y,g; int main(){ while(c<=1e+9) f[i++]=c=(a=b)+(b=c); scanf("%d",&t); for(x=0;x<t;++x){ scanf("%d",&n); g=0; for(y=0;y<i;++y) if (n%f[y]==0&&std::binary_search(f,f+i,n/f[y])) g=1; puts(g?"TAK":"NIE"); } return 0; } |