Вопрос задан 06.05.2019 в 21:40. Предмет Информатика. Спрашивает Змеев Данил.

Написать программу Pascal для печати звездочками одной из фигур: в)домика

0 0
Перейти к ответам

Ответы на вопрос

Внимание! Ответы на вопросы дают живые люди. Они могут содержать ошибочную информацию, заблуждения, а также ответы могут быть сгенерированы нейросетями. Будьте внимательны. Если вы уверены, что ответ неверный, нажмите кнопку "Пожаловаться" под ответом.
Отвечает Маслакова Полина.

скачать просто в ине и всё 

0 0
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

Program in Pascal to Print a House Shape

Here's a program written in Pascal that prints a house shape using asterisks:

```pascal program PrintHouse;

var i, j, n: integer;

begin n := 5; // number of rows for the house shape

// print the roof for i := 1 to n do begin for j := 1 to n - i do write(' '); for j := 1 to 2 * i - 1 do write('*'); writeln; end;

// print the walls for i := 1 to n do begin write('*'); for j := 1 to 2 * n - 3 do begin if i = n then write('*') else write(' '); end; writeln('*'); end;

// print the base for i := 1 to 2 * n - 1 do write('*'); writeln; end. ```

This program uses nested loops to print the roof, walls, and base of the house shape. The variable `n` determines the number of rows for the house shape, and you can adjust it to change the size of the house.

The program starts by printing the roof using two nested loops. The outer loop controls the number of rows, and the inner loops print the spaces and asterisks for each row.

Next, the program prints the walls using another set of nested loops. The outer loop controls the number of rows, and the inner loop prints the spaces and asterisks for each row. The condition `if i = n then` is used to determine whether to print asterisks or spaces for the last row of the walls.

Finally, the program prints the base by printing a row of asterisks.

To run this program, you can use a Pascal compiler or an online Pascal compiler.

I hope this helps! Let me know if you have any further questions.

0 0

Топ вопросов за вчера в категории Информатика

Последние заданные вопросы в категории Информатика

Задать вопрос