Задача 1 update - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of Задача 1 update.php

  1. <?php
  2. $rangeList = range(1,100);
  3.  
  4.  
  5. $result = [];
  6. for ($i=1;!empty($rangeList);$i++) {
  7.     $result[] = array_splice($rangeList, 0, $i);  
  8. }
  9. foreach($result as $rowList) {
  10.     echo implode(" ", $rowList) . "\n";
  11. }
  12. //последнюю строку оставляю как есть, т.к. не было никаких инструкций по ней
File Description
  • Задача 1 update
  • PHP Code
  • 26 Aug-2022
  • 348 Bytes
You can Share it: