Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. $bestScore = PHP_INT_MIN;
  5. $bestPlayer = " ";
  6.  
  7. while (TRUE) {
  8. $player = readline();
  9. if ($player == "END"){
  10. break;
  11. }
  12. $goals = intval(readline());
  13. if ($goals > $bestScore) {
  14. $bestScore = $goals;
  15. $bestPlayer = $player;
  16. }
  17. if ($goals >= 10) {
  18. break;
  19. }
  20. }
  21. echo "$bestPlayer is the best player!" . PHP_EOL;
  22.  
  23. if ($bestScore>=3) {
  24. echo "He has scored $bestScore goals and made a hat-trick !!!";
  25. } else {
  26. echo "He has scored $goals goals.";
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement