fork(2) download
  1. <?php
  2. //$payment=5000;
  3. function balance ($payment,$percent,$commission,$paymentForNothing){
  4. $creditTotal = 0;
  5. $creditTotal-=$paymentForNothing;
  6. $k = 0;
  7. for($i=0;$creditTotal<=40000;$i++){
  8. $creditTotal += $payment-$payment*$percent-$commission;
  9. if (40000)
  10. $k++;
  11. }
  12. return $creditTotal;
  13. }
  14. $homoCredit = balance(5000,0.04,500,0);
  15. $softBank = balance(5000,0.03,1000,0);
  16. $strawberryBank = balance(5000,0.02,0,7777);
  17. echo"In Homocredit bank you need to spent $homoCredit money before payment ends\n";
  18. echo"In SoftBank bank you need to spent $softBank money before payment ends\n";
  19. echo"In StrawberryBank bank you need to spent $strawberryBank money before payment ends\n";
  20. // your code goes here
Success #stdin #stdout 0.02s 52472KB
stdin
Standard input is empty
stdout
In Homocredit bank you need to spent 43000 money before payment ends
In SoftBank bank you need to spent 42350 money before payment ends
In StrawberryBank bank you need to spent 41223 money before payment ends