fork(1) download
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4.  
  5.  
  6. bool sprawdz(int n)
  7. {
  8. if (n<2)
  9. return false;
  10. for (int i = 2; i*i <= n; i++)
  11. if (n%i == 0)
  12. return false;
  13. return true;
  14. }
  15.  
  16. int main()
  17. {
  18. int n;
  19. cin >> n;
  20.  
  21. for (int i = n; i > 0; i--)
  22. {
  23. if (sprawdz(i))
  24. cout << "TAK" << endl;
  25. else
  26. cout << "NIE" << endl;
  27.  
  28. }
  29. system("pause");
  30.  
  31. return 0;
  32. }
Success #stdin #stdout #stderr 0s 16064KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
sh: 1: pause: not found