fork(2) download
  1. <?php
  2.  
  3. // your code goes here
  4. echo "OK! Let's do this!";
  5.  
  6. $credit = 40000;
  7. $fee = 0.03;
  8. $comission = 1000;
  9.  
  10. $can_pay = 5000;
  11. $months = 0;
  12. $total = 0;
  13.  
  14. while ($credit > 0) {
  15. $months += 1;
  16. $credit += $credit * $fee + $comission - $can_pay;
  17. $total += $can_pay;
  18. }
  19.  
  20. $total += $credit;
  21.  
  22. echo " It'll take $months months and will cost near $total";
Success #stdin #stdout 0.02s 52432KB
stdin
Standard input is empty
stdout
OK! Let's do this! It'll take 13 months and will cost near 61270.186744521