<?php
function getBalance( $dept , $payout , $percent , $commission , $extra ) {
$dept = $dept + $extra ;
for ( $i = 0 ; $i < 40 ; $i ++ ) {
$dept = $dept * $percent + $commission ;
$dept = $dept - $payout ;
if ( $dept <= $payout ) {
$dept = $payout ;
$dept = $dept - $payout ;
}
}
return $dept ;
}
$dept = 39999 ;
$payout = 5000 ;
$homoCreditTotal = getBalance( $dept , $payout , 1.04 , 500 , 0 ) ;
$softCreditTotal = getBalance( $dept , $payout , 1.03 , 1000 , 0 ) ;
$strawberryCreditTotal = getBalance( $dept , $payout , 1.02 , 0 , 7777 ) ;
echo "После выплаты кредита в первом банке, наш баланс по кредиту будет составлять {$homoCreditTotal} рублей, во втором банке {$softCreditTotal} рублей, а в третьем {$strawberryCreditTotal} рублей." ;
PD9waHAKCmVycm9yX3JlcG9ydGluZygtMSk7CgpmdW5jdGlvbiBnZXRCYWxhbmNlKCRkZXB0LCAkcGF5b3V0LCAkcGVyY2VudCwgJGNvbW1pc3Npb24sICRleHRyYSl7CgkkZGVwdCA9ICRkZXB0KyRleHRyYTsKCWZvcigkaT0wOyRpPDQwOyRpKyspewoJCSRkZXB0ID0gJGRlcHQgKiAkcGVyY2VudCArICRjb21taXNzaW9uOwoJCSRkZXB0ID0gJGRlcHQgLSAkcGF5b3V0OwoJCWlmKCRkZXB0PD0kcGF5b3V0KXsKCQkJJGRlcHQgPSAkcGF5b3V0OwoJCQkkZGVwdCA9ICRkZXB0IC0gJHBheW91dDsKCQl9Cgl9CgkKCXJldHVybiAkZGVwdDsKfQoKJGRlcHQgPSAzOTk5OTsKJHBheW91dCA9IDUwMDA7CiRob21vQ3JlZGl0VG90YWwgPSBnZXRCYWxhbmNlKCRkZXB0LCAkcGF5b3V0LCAxLjA0LCA1MDAsIDApOwokc29mdENyZWRpdFRvdGFsID0gZ2V0QmFsYW5jZSgkZGVwdCwgJHBheW91dCwgMS4wMywgMTAwMCwgMCk7CiRzdHJhd2JlcnJ5Q3JlZGl0VG90YWwgPSBnZXRC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