fork(3) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int n;
  6. int x;
  7. int ile;
  8. int main()
  9. {
  10. cin >> n;
  11.  
  12. for (int i=0; i<n; i++){
  13. ile = 0;
  14. cin >> x;
  15. for ( int j=1; j<=x; j++)
  16. {
  17. if(x%j == 0)
  18. {
  19. ile++;
  20. }
  21. }
  22. if (ile == 2){
  23. cout << "TAK";
  24. } else cout << "NIE";
  25. }
  26.  
  27. return 0;
  28. }
Success #stdin #stdout 0s 2732KB
stdin
3
11
1
4
stdout
TAKNIENIE