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