Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $payment = floatval(readline());
- $years = intval(readline());
- $sinidcate = strtolower(readline());
- $counter = 0;
- for ($i = $payment; $i <= 5000; $i++) {
- $payment = $payment * 1.06;
- ++$counter;
- if ($counter == $years) {
- echo $payment . "\n";
- echo $counter;
- }
- if ($counter % 5 == 0 && $counter % 10 != 0) {
- $payment += 100;
- }
- if ($counter % 10 == 0) {
- $payment += 200;
- }
- if ($sinidcate == "yes" && $i % 5 != 0) {
- $payment = $payment - 1.01;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement