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