fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. int h = int.Parse(Console.ReadLine());
  8. Pyramid('*', h);
  9. }
  10.  
  11. static void Pyramid(char c, int h)
  12. {
  13. for (var i = 0; i < h; i++)
  14. {
  15. Console.Write(new string(' ', h - i - 1));
  16. Console.WriteLine(new string('*', 2 * i + 1));
  17. }
  18. }
  19. }
Success #stdin #stdout 0.04s 24240KB
stdin
17
stdout
                *
               ***
              *****
             *******
            *********
           ***********
          *************
         ***************
        *****************
       *******************
      *********************
     ***********************
    *************************
   ***************************
  *****************************
 *******************************
*********************************