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