fork(2) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. unsigned int liczba,test,helper=0;
  8. int *tab=new int;
  9. cin >>test;
  10. if(test<100000)
  11. {
  12.  
  13. for(int i=0;i<test;i++){ cin >> tab[i]; if(tab[i]>10000 || tab[i]<=0) return 0;}
  14.  
  15. for(int j=0;j<test;j++) {
  16.  
  17. for(int i=1;i<11;i++){
  18. if(tab[j]%i==0 ){helper++;}
  19. }
  20. if(helper==1 &&tab[j]>1) cout << "TAK"<<endl;
  21. else cout << "NIE"<<endl;
  22. helper=0;
  23. }
  24. }
  25. return 0;
  26. }
Success #stdin #stdout 0s 4268KB
stdin
4
2
3
5
7
stdout
NIE
NIE
NIE
NIE