fork(1) download
  1. <?php
  2.  
  3.  
  4. function costOfHomoCredit($money, $payout){
  5. $sum = 0;
  6. for($i = 0; ($money*1.04+500)>$payout; $i++){
  7. $money = $money*1.04-$payout + 500;
  8. $sum += $payout;
  9. }
  10. if($money!=0) $sum+=$money;
  11. return $sum;
  12. }
  13.  
  14. function costOfSoftBank($money, $payout){
  15. $sum = 0;
  16. for($i = 0; ($money*1.03+1000)>$payout; $i++){
  17. $money = $money*1.03-$payout + 1000;
  18. $sum += $payout;
  19. }
  20. if($money!=0) $sum+=$money;
  21. return $sum;
  22. }
  23.  
  24. function costOfStrawberryBank($money, $payout){
  25. $sum = 0;
  26. $money += 7777;
  27. for($i = 0; ($money*1.02)>$payout; $i++){
  28. $money = $money*1.02-$payout;
  29. $sum += $payout;
  30. }
  31. if($money!=0) $sum+=$money;
  32. return $sum;
  33. }
  34.  
  35. $creditSum = 39999;
  36. $payout = 5000;
  37. $homoCreditTotal = costOfHomoCredit($creditSum, $payout);
  38. $softBankTotal = costOfSoftBank($creditSum, $payout);
  39. $strawberryBankTotal = costOfStrawberryBank($creditSum, $payout);
  40.  
  41. echo "homoCredit: $homoCreditTotal\n";
  42. echo "softBank: $softBankTotal\n";
  43. echo "strawBerry: $strawberryBankTotal\n";
Success #stdin #stdout 0.03s 52480KB
stdin
Standard input is empty
stdout
homoCredit: 55888.041463101
softBank: 60260.891466803
strawBerry: 53490.07241098