fork download
  1. <?php
  2.  
  3. $creditSum = 40000;
  4. $payOut = 5000;
  5. $paymentTotal = 0;
  6.  
  7. function bank($percent, $comission){
  8. for ($mounth = 0; $mounth <= 20; $mounth++){
  9.  
  10. if($creditSum*$percent+$comission <= $payOut) {
  11. $payOut = $creditSum*$percent+$comission;
  12. $creditSum = $creditSum*$percent+$comission - $payOut;
  13. $paymentTotal = $paymentTotal + $payOut;
  14. break;
  15. }
  16.  
  17.  
  18. $creditSum = $creditSum*$percent + $comission - $payOut;
  19. $paymentTotal = $paymentTotal + $payOut;
  20.  
  21. }
  22.  
  23. return $paymentTotal;
  24. }
  25.  
  26. $dengi = bank(1.04, 500);
  27. echo "Всего выплачено {$dengi} ";
  28. ?>
Success #stdin #stdout #stderr 0.02s 52472KB
stdin
Standard input is empty
stdout
Всего выплачено 0 
stderr
PHP Notice:  Undefined variable: creditSum in /home/7jkk4e/prog.php on line 11
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 11
PHP Notice:  Undefined variable: creditSum in /home/7jkk4e/prog.php on line 19
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 19
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 20
PHP Notice:  Undefined variable: paymentTotal in /home/7jkk4e/prog.php on line 20
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 11
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 19
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 20
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 11
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 19
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 20
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 11
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 19
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 20
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 11
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 19
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 20
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 11
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 19
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 20
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 11
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 19
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 20
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 11
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 19
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 20
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 11
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 19
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 20
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 11
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 19
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 20
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 11
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 19
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 20
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 11
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 19
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 20
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 11
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 19
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 20
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 11
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 19
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 20
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 11
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 19
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 20
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 11
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 19
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 20
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 11
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 19
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 20
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 11
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 19
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 20
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 11
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 19
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 20
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 11
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 19
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 20
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 11
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 19
PHP Notice:  Undefined variable: payOut in /home/7jkk4e/prog.php on line 20