fork(1) download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. unsigned int x,n;
  7. scanf("%d",&n);
  8.  
  9. int tab[n-1];
  10.  
  11. for(x=0;x<n;x++)
  12. scanf("%d",&tab[x]);
  13.  
  14. int i,j=0,k;
  15. for(k=0;k<n;k++){
  16. for(i=1;i<=10;i++){
  17. if(((tab[k]%i)&&(tab[k]>0))==0)
  18. j++;
  19. }
  20. if(tab[k]==1){
  21. printf("NIE\n");
  22. j=0;
  23. }
  24. else if(tab[k]==2||tab[k]==3||tab[k]==5||tab[k]==7){
  25. printf("TAK\n");
  26. j=0;
  27. }
  28. else if(j==1){
  29. printf("TAK\n");
  30. j=0;
  31. }
  32. else{
  33. printf("NIE\n");
  34. j=0;
  35. }
  36. }
  37.  
  38. return 0;
  39. }
  40.  
Success #stdin #stdout 0s 9424KB
stdin
3
1
4
11
stdout
NIE
NIE
TAK