fork download
  1. <?php
  2.  
  3.  
  4. $money=10000;
  5. $percent=1.1;
  6.  
  7. for ($year=1; $year<=10;$year++){
  8.  
  9.  
  10. $money = $money*$percent;
  11.  
  12. echo{$year}-й год будет {$money} на счету.\n ";
  13.  
  14.  
  15.  
  16. if ($everyYear>1000000){
  17. echo "Наконец накопил!\n";
  18.  
  19. break;
  20. }
  21. }
Success #stdin #stdout #stderr 0s 82880KB
stdin
Standard input is empty
stdout
В 1-й год будет 11000 на счету.
 В 2-й год будет 12100 на счету.
 В 3-й год будет 13310 на счету.
 В 4-й год будет 14641 на счету.
 В 5-й год будет 16105.1 на счету.
 В 6-й год будет 17715.61 на счету.
 В 7-й год будет 19487.171 на счету.
 В 8-й год будет 21435.8881 на счету.
 В 9-й год будет 23579.47691 на счету.
 В 10-й год будет 25937.424601 на счету.
 
stderr
PHP Notice:  Undefined variable: everyYear in /home/QHiede/prog.php on line 17
PHP Notice:  Undefined variable: everyYear in /home/QHiede/prog.php on line 17
PHP Notice:  Undefined variable: everyYear in /home/QHiede/prog.php on line 17
PHP Notice:  Undefined variable: everyYear in /home/QHiede/prog.php on line 17
PHP Notice:  Undefined variable: everyYear in /home/QHiede/prog.php on line 17
PHP Notice:  Undefined variable: everyYear in /home/QHiede/prog.php on line 17
PHP Notice:  Undefined variable: everyYear in /home/QHiede/prog.php on line 17
PHP Notice:  Undefined variable: everyYear in /home/QHiede/prog.php on line 17
PHP Notice:  Undefined variable: everyYear in /home/QHiede/prog.php on line 17
PHP Notice:  Undefined variable: everyYear in /home/QHiede/prog.php on line 17