<?php $money=10000; $percent=1.1; for ($year=1; $year<=10;$year++){ $money = $money*$percent; echo"В {$year}-й год будет {$money} на счету.\n "; if ($everyYear>1000000){ echo "Наконец накопил!\n"; break; } }
Standard input is empty
В 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 на счету.
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