fork(6) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int l, n, ilosc=1;
  8. cin>>n;
  9. while(n--)
  10. {
  11. cin>>l;
  12. for(int i=2; i<=l; i++ )
  13. {
  14. if((l % i==0))
  15. {
  16. ilosc++;
  17. }
  18. if(ilosc>2)
  19. break;
  20. }
  21. if(l==1)
  22. {
  23. cout<<"NIE"<<endl;
  24. }
  25. else if(ilosc!=2)
  26. {
  27. cout<<"NIE"<<endl;
  28. }
  29. else if(ilosc==2)
  30. {
  31. cout<<"TAK"<<endl;
  32.  
  33. }
  34.  
  35. }
  36.  
  37. return 0;
  38. }
Success #stdin #stdout 0s 5556KB
stdin
3
11
1
4
stdout
TAK
NIE
NIE