Guest User

Untitled

a guest
Apr 21st, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  * @author Petr Brazdil
  5.  * @copyright 2011
  6.  */
  7.  
  8. $i = -20;
  9. while ($i < 20) {
  10.     $provedlo = false;
  11.     $x = -5;
  12.     $y = $i;
  13.     $c = 0;
  14.     while ($x < $y) {
  15.         $c++;
  16.         $x = $x + 5;
  17.         $y = (int)($x / 5) + $y + 2;
  18.         $provedlo = true;
  19.         if ($c > 30) {
  20.             $c = 0;
  21.             break;
  22.         }
  23.     }
  24.     echo 'A = '.$i.', pocet kroku -> '.$c.'<br>';
  25.    
  26.     if ($c == 2) {
  27.        // echo 'Hledane -> '.$i.'<br>';
  28.     }
  29.     $i++;
  30. }
  31.  
  32. ?>
Add Comment
Please, Sign In to add comment