fork(3) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int n;
  7. bool pf=true, fp=false;
  8. while(pf)
  9. {
  10. cin>>n;
  11. if(n<100000)
  12. pf=false;
  13. }
  14. string odp[n];
  15. for(int i=0; i<n; i++)
  16. {
  17. pf=true;
  18. fp=false;
  19. int x;
  20. while(pf)
  21. {
  22. cin >>x;
  23. if(x<10000)
  24. pf=false;
  25. }
  26. for(int i=x-1; i>1; i--)
  27. {
  28. if(x%i==0)
  29. {
  30. fp=true;
  31. i=1;
  32. }
  33. }
  34. if(x>1 && fp==false && x%x==0)
  35. {
  36.  
  37. odp[i]="TAK";
  38. }
  39. else
  40. odp[i]="NIE";
  41. }
  42. for(int i =0; i<n; i++)
  43. cout << odp[i] <<endl;
  44. return 0;
  45. }
Runtime error #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
Standard output is empty