fork download
  1. <?php
  2. function countMoney($creditSum, $initialFee, $percent, $comission, $payment, $payout)
  3. {
  4. $creditSum = $creditSum + $initialFee;
  5. $percent = $percent + 100;
  6. for ($i = 1; $i <= 20; $i++) {
  7. $creditSum = $creditSum * $percent / 100 + $comission - $payout;
  8. echo "$i m - {$creditSum}.\n";
  9. $payment = $i * $payout;
  10. if ($creditSum * $percent / 100 + $comission < 5000) {
  11. $payment = $payment + ($creditSum * $percent / 100 + $creditSum + $comission);
  12. echo "Last {$creditsum}"
  13. break;
  14. }
  15. }
  16. return $payment;
  17. }
  18. /* //homocredit
  19.   $creditSum = 39999;
  20.   $initialFee = 0;
  21.   $percent = 4;
  22.   $comission = 500;
  23.   $payment = 0;
  24.   $payout = 5000;
  25.   $homocredit = countMoney($creditSum,$initialFee, $percent, $comission, $payment, $payout);
  26.   echo "HomoCredit: {$homocredit} рублей.\n";*/
  27. //softbank
  28. $creditSum = 39999;
  29. $initialFee = 0;
  30. $percent = 3;
  31. $comission = 1000;
  32. $payment = 0;
  33. $payout = 5000;
  34. $softbank = countMoney($creditSum,$initialFee, $percent, $comission, $payment, $payout);
  35. echo "SoftBank: {$softbank} рублей.\n";
  36.  
  37. /* //Strawbeerybank
  38. $creditSum = 39999;
  39. $initialFee = 7777;
  40.   $percent = 2;
  41.   $comission = 0;
  42.   $payment = 0;
  43.   $payout = 5000;
  44.   $stawberrybank = countMoney($creditSum,$initialFee, $percent, $comission, $payment, $payout);
  45.   echo "StrawberryBank: {$stawberrybank} рублей.\n";
  46.   $benefit = min($homocredit,$softbank,$stawberrybank);
  47.   echo "Наивыгодный кредит - {$benefit}!";*/
Runtime error #stdin #stdout #stderr 0.03s 52480KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Parse error:  syntax error, unexpected 'break' (T_BREAK), expecting ',' or ';' in /home/6xNTvR/prog.php on line 14