<?php
function totalPay( $creditSum , $monthPay , $monthPercent , $tax ) {
for ( $i = 0 ; $i <= 20 ; $i ++ ) {
$totalPayBank = $creditSum * $monthPercent + $tax - $monthPay ;
$total = $total + $monthPay ;
}
return $total ;
}
$creditSum = 39999 ;
$monthPay = 5000 ;
$homoCreditTotal = totalPay( 39999 , 5000 , 1.04 , 500 ) ;
$softBankTotal = totalPay( 39999 , 5000 , 1.03 , 1000 ) ;
$strawberryBank = totalPay( 39999 , 5000 , 1.02 , 7777 ) ;
echo "{$homoCreditTotal} \n " ;
echo "{$softBankTotal} \n " ;
PD9waHAKZXJyb3JfcmVwb3J0aW5nKC0xKTsKZnVuY3Rpb24gdG90YWxQYXkoJGNyZWRpdFN1bSwgJG1vbnRoUGF5LCAkbW9udGhQZXJjZW50LCAkdGF4KXsKICAgIGZvciAoJGkgPSAwOyAkaSA8PSAyMDsgJGkrKyl7CiAgICAJJHRvdGFsUGF5QmFuayA9ICRjcmVkaXRTdW0gKiAkbW9udGhQZXJjZW50ICsgJHRheCAtICRtb250aFBheTsKICAgIAkkdG90YWwgPSAkdG90YWwgKyAkbW9udGhQYXk7CiAgICB9CiAgICByZXR1cm4gJHRvdGFsOwp9CgokY3JlZGl0U3VtID0gMzk5OTk7CiRtb250aFBheSA9IDUwMDA7CiRob21vQ3JlZGl0VG90YWwgPSB0b3RhbFBheSgzOTk5OSwgNTAwMCwgMS4wNCwgNTAwKTsKJHNvZnRCYW5rVG90YWwgPSB0b3RhbFBheSgzOTk5OSwgNTAwMCwgMS4wMywgMTAwMCk7CiRzdHJhd2JlcnJ5QmFuayA9IHRvdGFsUGF5KDM5OTk5LCA1MDAwLCAxLjAyLCA3Nzc3KTsKCmVjaG8gInskaG9tb0NyZWRpdFRvdGFsfVxuIjsKZWNobyAieyRzb2Z0QmFua1RvdGFsfVxuIjsK