fork download
  1. #!/usr/bin/perl
  2. $m = <> and map { $s=' 'x$m and substr($s, $m-$_,2*$_+1) = '*'x(2*$_+1) and print "$s\n" } (0..$m);
  3.  
Success #stdin #stdout 0s 3608KB
stdin
12
stdout
            *
           ***
          *****
         *******
        *********
       ***********
      *************
     ***************
    *****************
   *******************
  *********************
 ***********************
*************************