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