fork download
  1. <?php
  2.  
  3. function HomoCredit($creditSum, $payout){
  4. $totalPayout =0;
  5. for(;;){
  6. $creditSum = ($creditSum*1.04)+500;
  7. if ($creditSum<=5000) {
  8. $totalPayout = $totalPayout + $creditSum;
  9. break;
  10. }
  11. $creditSum = $creditSum - $payout;
  12. $totalPayout = $totalPayout + $payout;
  13. }
  14. return $totalPayout;
  15. }
  16.  
  17. function Softbank($creditSum, $payout){
  18. $totalPayout =0;
  19. for(;;){
  20. $creditSum = ($creditSum*1.03)+1000;
  21. if ($creditSum<=5000) {
  22. $totalPayout = $totalPayout + $creditSum;
  23. break;
  24. }
  25. $creditSum = $creditSum - $payout;
  26. $totalPayout = $totalPayout + $payout;
  27. }
  28. return $totalPayout;
  29. }
  30.  
  31. function StrawberryBank ($creditSum, $payout){
  32. $totalPayout =0;
  33. for(;;){
  34. $creditSum = ($creditSum*1.02);
  35. if ($creditSum<=5000) {
  36. $totalPayout = $totalPayout + $creditSum + 7777;
  37. break;
  38. }
  39. $creditSum = $creditSum - $payout;
  40. $totalPayout = $totalPayout + $payout;
  41. }
  42. return $totalPayout;
  43. }
  44.  
  45. $creditSum = 39999;
  46. $payout = 5000;
  47. $HomoCreditTotal = HomoCredit($creditSum, $payout);
  48. $SoftbankTotal = Softbank($creditSum, $payout);
  49. $StrawberryBankTotal = StrawberryBank($creditSum, $payout);
  50.  
  51. echo "1 - {$HomoCreditTotal}\n";
  52. echo "2 - {$SoftbankTotal}\n";
  53. echo "3 - {$StrawberryBankTotal}\n";
Success #stdin #stdout 0.02s 52432KB
stdin
Standard input is empty
stdout
1 - 56423.563121625
2 - 61268.718210807
3 - 51806.365496746