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