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