SHARE
TWEET

Bonus score

a guest Mar 24th, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $points = intval(readline());
  4. $Bonus = 0;
  5. if ($points <= 100) {
  6.     $Bonus = 5;
  7. } else if ($points > 100 && $points <= 1000) {
  8.     $Bonus = $points * 0.2;
  9. } else {
  10.     $Bonus = $points * 0.1;
  11. }
  12. if ($points % 2 == 0) {
  13.     $Bonus += 1;
  14. } else if ($Bonus % 10 === 5) {
  15.     $Bonus += 2;
  16. }
  17. echo $Bonus . PHP_EOL;
  18. Echo $Bonus + $points;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top