Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * @author Petr Brazdil
- * @copyright 2011
- */
- $i = -20;
- while ($i < 20) {
- $provedlo = false;
- $x = -5;
- $y = $i;
- $c = 0;
- while ($x < $y) {
- $c++;
- $x = $x + 5;
- $y = (int)($x / 5) + $y + 2;
- $provedlo = true;
- if ($c > 30) {
- $c = 0;
- break;
- }
- }
- echo 'A = '.$i.', pocet kroku -> '.$c.'<br>';
- if ($c == 2) {
- // echo 'Hledane -> '.$i.'<br>';
- }
- $i++;
- }
- ?>
Add Comment
Please, Sign In to add comment