
25 баллов. Чиновник, ежемесячно берёт взятки в размере Х рублей. Величина Х непостоянная и
колеблется от 0 до 150000 рублей. Автомобиль BMW 3, который хочет купить на взятки чиновник, стоит 1700000 рублей. Напишите программу, которая вычислит, сколько месяцев потребуется чиновнику на сбор нужной суммы. Просьба не копипастить!

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

begin
average := (150000 + 0);
months := 1700000 / average;
write('В среднем чиновнику потребуется ');
write(months:5:2);
write(' месяцев.');
end.



To calculate how many months it will take for the official to accumulate the necessary amount of money to buy the BMW 3 car, we can use a simple program. Here's an example of how you can write it in Python:
```python car_price = 1700000 bribe_range = range(0, 150001, 1000) # Range of bribe amounts from 0 to 150,000 in steps of 1000
for bribe in bribe_range: months = car_price // bribe # Integer division to get the number of months if months > 0: print(f"With a bribe of {bribe} rubles, it will take the official approximately {months} months to accumulate enough money for the car.") ```
This program will iterate through the range of bribe amounts from 0 to 150,000 in steps of 1000. For each bribe amount, it will calculate the number of months required to accumulate enough money for the car using integer division (`//`). If the number of months is greater than 0, it will print the result.
Please note that this program assumes that the official saves all the bribe money without spending any of it. It also assumes that the bribe amount is constant throughout the accumulation period. In reality, these assumptions may not hold true.
Let me know if you need any further assistance!


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








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