fork download
  1. #include<iostream>
  2. using namespace std;
  3. #include<cmath>
  4.  
  5. int main()
  6. {
  7. long long liczba = 0;
  8. for(auto j = 0; j<1000; ++j)
  9. {
  10. cin >> liczba;
  11. if (liczba == 1)
  12. {
  13. cout << "NIE\n";
  14. }
  15. else if (liczba > 1 && liczba <= 10000)
  16. {
  17.  
  18. int spr = 0;
  19. for (auto i = 2; i <= sqrt(liczba); ++i)
  20. {
  21. spr = liczba%i;
  22. if (spr == 0)
  23. {
  24. cout << "NIE\n";
  25. break;
  26. }
  27. }
  28. if (spr != 0 || liczba == 3 || liczba == 2)
  29. cout << "TAK\n";
  30. }
  31. }
  32. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
Standard output is empty