Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $count = fgets(STDIN);
- for($i = 0; $count > $i ; $i++){
- $current = fgets(STDIN);
- if($current == 0 || $current == 1){
- echo "NIE\n";
- } else {
- if($current == 2){ echo "TAK\n"; continue; }
- for($p = 2; $current > $p; $p++){
- if(!($current % $p)){
- echo "NIE\n";
- continue 2;
- }
- }
- echo "TAK\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement