public static void Main()
Console.WriteLine("Podaj pierwszą liczbę:");
x = Convert.ToInt32(Console.ReadLine());
if (x <= 0) Console.WriteLine("Musisz podać liczbę większą od zera!");
Console.WriteLine("Podaj drugą liczbę:");
y = Convert.ToInt32(Console.ReadLine());
if (y <= x) Console.WriteLine("Musisz podać liczbę większą od {0}!", x);
for (int i = (x % 2 == 0 ? x + 1 : x); i <= y; i += 2) height += i;
for (int i = 1; i <= height; i++) {
for (int j = i; j < height; j++) Console.Write(" ");
for (int k = 1; k <= (2 * i - 1); k++) Console.Write((k == 1 || k == (2*i -1) || i == height) ? "*" : " ");
Console.Write(Environment.NewLine);