Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. <?php
  2. $count = fgets(STDIN);
  3. for($i = 0; $count > $i ; $i++){
  4.  
  5. $current = fgets(STDIN);
  6.  
  7. if($current == 0 || $current == 1){
  8. echo "NIE\n";
  9. } else {
  10. if($current == 2){ echo "TAK\n"; continue; }
  11.  
  12. for($p = 2; $current > $p; $p++){
  13. if(!($current % $p)){
  14. echo "NIE\n";
  15. continue 2;
  16. }
  17. }
  18.  
  19. echo "TAK\n";
  20.  
  21. }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement