Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- echo "Start : ";
- $start = str_replace("\n","",fgets(STDIN));
- echo "Rows : ";
- $rows = str_replace("\n","",fgets(STDIN));
- echo "Cols : ";
- $cols = str_replace("\n","",fgets(STDIN));
- for($a = 0;$a <= $rows;$a++){
- for($b = $start;$b < ($start+$cols);$b++){
- $arr[] = $a+$b;
- $str = implode(" ",$arr);
- $cs = chunk_split($str, $cols*2)."\n";
- }
- $ex = explode("\n",$cs);
- $row = $a+1;
- echo "Row ".$row." => ".$ex[$a]."\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement