fork download
  1. <?php
  2.  
  3.  
  4. $creditBalance = 39999;
  5. $monthlyPayment = 5000;
  6. $totalPayment = 0;
  7. $percent = 1.03;
  8. $payment = 1000;
  9.  
  10. do {
  11. for($month =1; $month <=20; $month ++) {
  12. $creditBalance = ( $creditBalance * $percent ) + $payment - $monthlyPayment;
  13. $paymentTotal = $paymentTotal + $monthlyPayment;
  14. echo "Месяц {$month} долг {$creditBalance} выплачено {$paymentTotal}\n";
  15. if (( $creditBalance * $percent ) + $payment <= $monthlyPayment) {
  16. $monthlyPayment = $creditBalance;
  17. }
  18. } while ($creditBalance == 0);
Runtime error #stdin #stdout #stderr 0.02s 24448KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Parse error:  syntax error, unexpected end of file in /home/TtBp0z/prog.php on line 19