Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $bestScore = PHP_INT_MIN;
- $bestPlayer = " ";
- while (TRUE) {
- $player = readline();
- if ($player == "END"){
- break;
- }
- $goals = intval(readline());
- if ($goals > $bestScore) {
- $bestScore = $goals;
- $bestPlayer = $player;
- }
- if ($goals >= 10) {
- break;
- }
- }
- echo "$bestPlayer is the best player!" . PHP_EOL;
- if ($bestScore>=3) {
- echo "He has scored $bestScore goals and made a hat-trick !!!";
- } else {
- echo "He has scored $goals goals.";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement