Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $broiKozunaci = readline();
- $bestChef = '';
- $bestChefPoints = 0;
- for($i = 0; $i < $broiKozunaci; $i ++) {
- $currentPoints = 0;
- $gotvach = readline();
- while(($ocenka = readline()) !== 'Stop') {
- $currentPoints = $currentPoints + (int)$ocenka;
- }
- echo "$gotvach has $currentPoints points." . PHP_EOL;
- if ($currentPoints > $bestChefPoints) {
- $bestChefPoints = $currentPoints;
- $bestChef = $gotvach;
- echo "$gotvach is the new number 1!" . PHP_EOL;
- }
- }
- echo $bestChef . " won competition with ". $bestChefPoints . " points!";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement