daydiff

Print a Christmas tree

Jun 24th, 2022
1,078
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.20 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. Example 1
  5. $height = 3
  6. Output:
  7.   *
  8.  * *
  9. *   *
  10. Example 2
  11. $height = 5
  12. Output:
  13.     *
  14.    * *
  15.   *   *
  16.  *     *
  17. *       *
  18. */
  19.  
  20. function printTree(int $height) {
  21.     // your code here
  22. }
Advertisement
Add Comment
Please, Sign In to add comment