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