fork(2) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. bool prime(int m)
  5. {
  6. if(m<2) return false;
  7.  
  8. for(int i = 2; i*i<=m; i++)
  9. if(m%i==0) return false;
  10.  
  11. }
  12. int m;
  13.  
  14. int main() {
  15. int tests;
  16. cin>>tests;
  17.  
  18. for(int i =1; i<=tests; i++ )
  19. {
  20. cin>> m;
  21.  
  22. {
  23. if(prime(m)==1)
  24. {
  25. cout<<"TAK"<<endl;
  26. }else cout<<"NIE"<<endl;
  27.  
  28.  
  29. }
  30.  
  31. }
  32.  
  33. return 0;
  34. }
  35.  
Success #stdin #stdout 0s 15232KB
stdin
10
1
2
3
4
5
6
7
8
9
10
stdout
NIE
NIE
NIE
NIE
NIE
NIE
NIE
NIE
NIE
NIE