Вопрос задан 23.02.2019 в 23:40. Предмет Информатика. Спрашивает Губаль Кира.

Во время пересадки леса работники посадили лес в зависимости от кол-во саженцев . саженцев ореха

хватило на первые сто метров, саженцев яблони ещё на сто метров, саженцев дуба хватило ещё на сто метров. Напишите программу которая выводит на печать название леса в зависимости от кол-во метров( пример 1..10:writeln(‘oreh’);).
0 0
Перейти к ответам

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

Внимание! Ответы на вопросы дают живые люди. Они могут содержать ошибочную информацию, заблуждения, а также ответы могут быть сгенерированы нейросетями. Будьте внимательны. Если вы уверены, что ответ неверный, нажмите кнопку "Пожаловаться" под ответом.
Отвечает Айса Досымхан.
Var
a :integer;
begin
repeat
writeln('Сколько метров?');
readln(a);
if a <= 100 then
 begin
   if a < 0 then writeln('Там нет леса!') else writeln('Там посажен орех.');
 end;
if a > 100 then
 begin
   if a <= 200 then writeln('Здесь посажена яблоня');
 end;
if a > 200 then
 begin
 if a <= 300 then writeln('Здесь посажен дуб.');
 if a > 300 then writeln('Здесь нет леса');
 end;
until a = 99999;
end.
0 0
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

Program to Print the Name of the Forest Based on the Number of Meters

To write a program that prints the name of the forest based on the number of meters, you can use conditional statements in most programming languages. Here's an example program in Python:

```python meters = int(input("Enter the number of meters: "))

if meters <= 100: print("oreh") elif meters <= 200: print("yabloni") elif meters <= 300: print("dub") else: print("Unknown forest") ```

In this program, the user is prompted to enter the number of meters. The program then uses conditional statements (`if`, `elif`, `else`) to determine the name of the forest based on the given number of meters. If the number of meters is less than or equal to 100, the program prints "oreh" (which means "walnut" in Russian). If the number of meters is between 101 and 200, it prints "yabloni" (which means "apple trees" in Russian). If the number of meters is between 201 and 300, it prints "dub" (which means "oak" in Russian). If the number of meters is greater than 300, it prints "Unknown forest".

You can run this program and test it by entering different numbers of meters to see the corresponding forest name printed on the screen.

Please note that this program assumes the input is a valid integer. If you need to handle invalid inputs or add more conditions, you can modify the program accordingly.

0 0

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

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

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