Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
660 B
1
Indexable
Never
program DrawNumber8;
var
  Width, Height, i, j: integer;
begin
  // Введите параметры ширины и высоты
  Write('Введите ширину: ');
  ReadLn(Width);
  Write('Введите высоту: ');
  ReadLn(Height);

  // Рисование цифры 8
  for i := 1 to Height do
  begin
    for j := 1 to Width do
    begin
      if ((i = 1) or (i = Height)) and ((j > 1) and (j < Width - 1)) or
         ((i > 1) and (i < Height) and ((j = 1) or (j = Width))) or
         ((i = Height div 2 + 1) and (j > 1) and (j < Width)) then
        Write('*')
      else
        Write(' ');
    end;
    Writeln;
  end;

  ReadLn;
end.
Leave a Comment