<?php
$credit = 40000 ;
$payment = 5000 ;
$procent = 1.03 ;
$comission = 1000 ;
$paymenTotal = 0
for ($month = 1 ; $month <= 12 ; $month ++) {
$credit= ($credit * $procent) - $payment + $comission ;
$paymentTotal = $paymentTotal + $payment ;
echo "Спустя $month месяцев выплачено $paymentTotal осталось выплатить $credit \n" ;
if ($credit <=0){
echo "Выплачено!" ;
break ;}
}
PD9waHAKCmVycm9yX3JlcG9ydGluZygtMSk7CiRjcmVkaXQgPSA0MDAwMCA7CiRwYXltZW50ID0gNTAwMCA7CiRwcm9jZW50ID0gMS4wMyA7CiRjb21pc3Npb24gPSAxMDAwIDsKJHBheW1lblRvdGFsID0gMAoKZm9yICgkbW9udGggPSAxIDsgJG1vbnRoIDw9IDEyIDsgJG1vbnRoICsrKSB7CgkkY3JlZGl0PSAoJGNyZWRpdCAqICRwcm9jZW50KSAtICRwYXltZW50ICsgJGNvbWlzc2lvbiA7CgkkcGF5bWVudFRvdGFsID0gJHBheW1lbnRUb3RhbCArICRwYXltZW50IDsKCWVjaG8gItCh0L/Rg9GB0YLRjyAkbW9udGgg0LzQtdGB0Y/RhtC10LIg0LLRi9C/0LvQsNGH0LXQvdC+ICRwYXltZW50VG90YWwg0L7RgdGC0LDQu9C+0YHRjCDQstGL0L/Qu9Cw0YLQuNGC0YwgJGNyZWRpdCBcbiIgOwoJaWYgKCRjcmVkaXQgPD0wKXsKICAgIGVjaG8gItCS0YvQv9C70LDRh9C10L3QviEiIDsKICAgIGJyZWFrIDt9Cn0KCg==