Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $points = intval(readline());
- $bonusPoints = 0;
- switch ($points) {
- case $points<=100:
- $bonusPoints = 5;
- break;
- case $points>100 && $points<=1000:
- $bonusPoints = $points * 0.2;
- break;
- case $points>1000:
- $bonusPoints = $points * 0.1;
- break;
- }
- switch ($points) {
- case $points % 2 == 0:
- $bonusPoints += 1;
- break;
- case $points % 10 === 5:
- $bonusPoints += 2;
- break;
- }
- echo $bonusPoints.PHP_EOL;
- echo $points + $bonusPoints;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement