Advertisement
terlichki

Untitled

Feb 26th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. <?php
  2.  
  3. $payment = floatval(readline());
  4. $years = intval(readline());
  5. $sinidcate = strtolower(readline());
  6. $counter = 0;
  7. for ($i = $payment; $i <= 5000; $i++) {
  8. $payment = $payment * 1.06;
  9. ++$counter;
  10. if ($counter == $years) {
  11. echo $payment . "\n";
  12. echo $counter;
  13. }
  14. if ($counter % 5 == 0 && $counter % 10 != 0) {
  15. $payment += 100;
  16. }
  17. if ($counter % 10 == 0) {
  18. $payment += 200;
  19. }
  20. if ($sinidcate == "yes" && $i % 5 != 0) {
  21. $payment = $payment - 1.01;
  22.  
  23. }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement