Advertisement
humarb

Chall mas rey

Jul 11th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.43 KB | None | 0 0
  1. <?php
  2. echo "Start : ";
  3. $start = str_replace("\n","",fgets(STDIN));
  4. echo "Rows : ";
  5. $rows = str_replace("\n","",fgets(STDIN));
  6. echo "Cols : ";
  7. $cols = str_replace("\n","",fgets(STDIN));
  8. for($a = 0;$a <= $rows;$a++){
  9.     for($b = $start;$b < ($start+$cols);$b++){
  10.         $arr[] = $a+$b;
  11.         $str = implode(" ",$arr);
  12.         $cs = chunk_split($str, $cols*2)."\n";
  13.     }
  14.     $ex = explode("\n",$cs);
  15.     $row = $a+1;
  16.     echo "Row ".$row." => ".$ex[$a]."\n";
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement