fork(1) download
  1. #include <iostream>
  2. #include <math.h>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int n;
  9. cin>>n;
  10. int z;
  11. string y;
  12. if(n<0 || n>100000) return 0;
  13.  
  14. for(int i=0;i<n;i++)
  15. {
  16. cin>>z;
  17. if(z<1 || z>100000) return 0;
  18. if(z==1)
  19. {
  20. y="NIE";
  21.  
  22. }
  23. if(z==2)
  24. {
  25. y="TAK";
  26.  
  27. }
  28.  
  29. for(int i=2;i<z;i++)
  30. {
  31. if(z%i==0)
  32. {
  33. y= "NIE";
  34.  
  35. break;
  36. }
  37.  
  38. }
  39.  
  40.  
  41. cout<<y<<endl;
  42. }
  43. return 0;
  44. }
Success #stdin #stdout 0s 4348KB
stdin
Standard input is empty
stdout
Standard output is empty