<?php
$percent = 1.1; /* 10% годовых */
$deposit = 10000;
$year = 16;
$times = 0;
for ($time= 1; $time <= 1000; $time ++) {
$deposit = $deposit * $percent;
$year = $year + 1;
$times = $times +1;
if ($deposit >= 1000000) {
echo "Некто станет миллионером в {$year} лет!\nДля этого потребуется {$time} лет\n";
break;
}
}
?>
PD9waHAKCmVycm9yX3JlcG9ydGluZygtMSk7CgokcGVyY2VudCA9IDEuMTsgLyogMTAlINCz0L7QtNC+0LLRi9GFICovCiRkZXBvc2l0ID0gMTAwMDA7CiR5ZWFyID0gMTY7CiR0aW1lcyA9IDA7Cgpmb3IgKCR0aW1lPSAxOyAkdGltZSA8PSAxMDAwOyAkdGltZSArKykgewoJJGRlcG9zaXQgPSAkZGVwb3NpdCAqICRwZXJjZW50OwoJJHllYXIgPSAkeWVhciArIDE7CgkkdGltZXMgPSAkdGltZXMgKzE7CglpZiAoJGRlcG9zaXQgPj0gMTAwMDAwMCkgewoJCWVjaG8gItCd0LXQutGC0L4g0YHRgtCw0L3QtdGCINC80LjQu9C70LjQvtC90LXRgNC+0Lwg0LIgeyR5ZWFyfSDQu9C10YIhXG7QlNC70Y8g0Y3RgtC+0LPQviDQv9C+0YLRgNC10LHRg9C10YLRgdGPIHskdGltZX0g0LvQtdGCXG4iOwoJCWJyZWFrOwoJfQp9Cj8+