fork download
  1. <?php
  2.  
  3.  
  4. function credit($summa, $persent, $plusVMesyac , $nachalniyVznos, $plataVMes) {
  5. for ($i = 1; $i <= 1000; $i++) {
  6. $skolkoViplatil = 0;
  7. $vsyaSumma = $summa + $nachalniyVznos;
  8. $vsyaSumma = ($summa * $persent + $plusVMesyac);
  9.  
  10.  
  11. if($vsyaSumma>$plataVMes){
  12. $vsyaSumma = $vsyaSumma - $plataVMes;
  13. } else {
  14. $plataVMes = $vsyaSumma;
  15. $vsyaSumma = $vsyaSumma - $plataVMes;
  16. }
  17. $skolkoViplatil = $skolkoViplatil + $plataVMes;
  18.  
  19. if ($vsyaSumma <= 0){
  20. break;
  21. }
  22. }
  23. }
  24.  
  25.  
  26. $creditsum - 39999;
  27. $payount = 5000;
  28. $homoCreditTotal = credit($creditsum, 1.04, 500, 0, $payount);
  29. $softBankTotal = credit($creditsum, 1.03, 1000, 0, $payount);
  30. $strawberryBankTotal = credit($creditsum, 1.02, 0, 7777, $payount);
  31.  
  32. echo $homoCreditTotal;
  33. echo $softBankTotal;
  34. echo $strawberryBankTotal;
Success #stdin #stdout #stderr 0.02s 24448KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Notice:  Undefined variable: creditsum in /home/QXApT6/prog.php on line 26