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

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

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.



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.


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







Последние заданные вопросы в категории Информатика
-
Математика
-
Литература
-
Алгебра
-
Русский язык
-
Геометрия
-
Английский язык
-
Химия
-
Физика
-
Биология
-
Другие предметы
-
История
-
Обществознание
-
Окружающий мир
-
География
-
Українська мова
-
Информатика
-
Українська література
-
Қазақ тiлi
-
Экономика
-
Музыка
-
Право
-
Беларуская мова
-
Французский язык
-
Немецкий язык
-
МХК
-
ОБЖ
-
Психология
-
Физкультура и спорт
-
Астрономия
-
Кыргыз тили
-
Оʻzbek tili