fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.  
  8. int is_prime=1;
  9. int testy;
  10. cin>>testy;
  11. for (int n=1; n<testy+1; n++)
  12. {
  13. int x;
  14. cin>>x;
  15. if (x<2)
  16. cout<<"NIE";
  17. if (x>1)
  18. {
  19. for (int i=2; i*i<=x; i++)
  20. {
  21. if (x%i==0)
  22. is_prime=0;
  23. }
  24. switch(is_prime)
  25. {
  26. case 0:
  27. cout << "NIE"<<endl;
  28. break;
  29. case 1:
  30. cout << "TAK"<<endl;
  31. default:
  32. break;
  33. }
  34. }
  35. }
  36. return 0;
  37. }
  38.  
Success #stdin #stdout 0s 16064KB
stdin
5
6
7
11
13
17

stdout
NIE
NIE
NIE
NIE
NIE