fork(1) download
  1. <?php
  2.  
  3.  
  4. $balance = 1100;
  5. $percent = 1.03;
  6.  
  7. for ($days = 1; $days <= 365; $days ++) {
  8.  
  9. $result = mt_rand(1, 100);
  10.  
  11. if (($result >= 1) && ($result <= 65)) {
  12. $balance = ( $balance * $percent );
  13. } elseif (($result >= 66) && ($result <= 85)) {
  14. $lowPercent = mt_rand(1, 2);
  15. if ($lowPercent == 1) {
  16. $balance = ( $balance * 1.01 );
  17. } else {
  18. $balance = ( $balance * 1.02 );
  19. }
  20. } else {
  21. $losePercent = mt_rand(1, 5);
  22. if ($losePercent == 1) {
  23. $balance = ( $balance * 0.99 );
  24. } elseif($losePercent == 2) {
  25. $balance = ( $balance * 0.98 );
  26. } elseif($losePercent == 3) {
  27. $balance = ( $balance * 0.97 );
  28. } elseif($losePercent == 4) {
  29. $balance = ( $balance * 0.96 );
  30. } else {
  31. $balance = ( $balance * 0.95 );
  32. }
  33.  
  34. }
  35.  
  36.  
  37. }
  38.  
  39. echo $balance;
  40.  
  41.  
Success #stdin #stdout 0.02s 52432KB
stdin
Standard input is empty
stdout
386086.1571972