Main.cs
usingSystem;classProgram {-
publicstaticintMain() { -
intheight;//высота -
charfill;//заполнитель -
charfill_no=' ';//заполнение пустоты -
Console.Write("Введите высоту : "); -
height =int.Parse(Console.ReadLine()); -
Console.Write("Введите заполнитель : "); -
fill = (char)Console.Read(); -
Console.WriteLine(); -
for(inti=0; i<height; i++) { -
for(intj=0; j<=height-1+i; j++) { -
if(j==(height-1-i) | j==(height-1+i) | i==(height-1)) { -
Console.Write(fill); -
} -
else{ -
Console.Write(fill_no); -
} -
} -
Console.WriteLine(); -
} -
Console.ReadKey(); -
return0; -
} }
usingSystem;classProgram {-
publicstaticintMain() { -
intheight;//высота -
charfill;//заполнитель -
charfill_no=' ';//заполнение пустоты -
Console.Write("Введите высоту : "); -
height =int.Parse(Console.ReadLine()); -
Console.Write("Введите заполнитель : "); -
fill = (char)Console.Read(); -
Console.WriteLine(); -
for(inti=0; i<height; i++) { -
for(intj=0; j<=height-1+i; j++) { -
if(j==(height-1-i) | j==(height-1+i) | i==(height-1)) { -
Console.Write(fill); -
} -
else{ -
Console.Write(fill_no); -
} -
} -
Console.WriteLine(); -
} -
Console.ReadKey(); -
return0; -
} }
Введите высоту : 8
Введите заполнитель : *
*
* *
* *
* *
* *
* *
* *
***************
Введите заполнитель : *
*
* *
* *
* *
* *
* *
* *
***************