Advertisement
Primaxm

Untitled

Sep 22nd, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. <?php
  2. $input = explode(", ", readline());
  3. $max = -2147483647;
  4. $min = 2147483647;
  5.  
  6. for ($i = 0; $i < $input[0]; $i++) {
  7. $arr = explode(", ", readline());
  8. $maxTmp = max($arr);
  9. $max = max($maxTmp, $max);
  10. $minTmp = min($arr);
  11. $min = min($minTmp, $min);
  12. }
  13.  
  14. echo "Min: $min\n";
  15. echo "Max: $max";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement