Untitled

 avatar
unknown
plain_text
2 years ago
716 B
5
Indexable
program DrawEight;
var
  i, j, height, width: Integer;
begin
  // Задайте высоту и ширину
  writeln('Задайте высоту восьмерке');
  readln(height);
  writeln('Задайте ширину восьмерке');
  readln(width);

  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)) then
        write('*')
      else if ((i > 1) and (i < height)) and ((j = 1) or (j = width)) then
        write('*')
      else if (i = height div 2 + 1) and ((j = 2) or (j = width - 1) or (j = width div 2 + 1)) then
        write('*')
      else
        write(' ');
    end;
    writeln;
  end;

  readln;
end.
Editor is loading...
Leave a Comment