Вопрос задан 01.11.2023 в 13:39. Предмет Информатика. Спрашивает Артамонова Дина.

Феофилакт хочет купить ракетки и шарики для игры в настольный теннис. Один комплект ракеток стоит A

рублей, один шарик стоит B рублей. У Феофилакта есть C рублей, C≥A, он покупает один комплект ракеток и шарики на оставшиеся деньги. Сколько шариков купит Феофилакт? Программа получает на вход три целых числа: A, B, C. Программа должна вывести ответ на задачу. Ввод 20 10 55 вывод 3 помогите пж задача по пайтону
0 0
Перейти к ответам

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

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

Ответ:

Объяснение:

begin

 println('Введите стоимость комплекта ракеток(А) и Шарика(B)');

 var (a,b) := ReadInteger2('A, B:');

 var c := ReadInteger('Наличные:');

assert(c >= a);

 print(Trunc((c - a) / b), 'Шр.')

end.


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

To solve this problem, we need to determine how many balls Feofilakt can buy with the remaining money after purchasing one set of rackets. Let's break down the problem step by step:

Step 1: Understand the problem

Feofilakt wants to buy one set of rackets and balls for playing table tennis. The cost of one set of rackets is A rubles, and the cost of one ball is B rubles. Feofilakt has C rubles, where C is greater than or equal to A.

Step 2: Calculate the number of balls Feofilakt can buy

To find out how many balls Feofilakt can buy, we need to subtract the cost of one set of rackets from the total amount of money he has and then divide the remaining amount by the cost of one ball.

Let's denote the number of balls Feofilakt can buy as X.

The equation to calculate X is: X = (C - A) / B

Step 3: Implement the solution in Python

Here's a Python program that solves the problem:

```python A, B, C = map(int, input().split())

X = (C - A) // B

print(X) ```

In this program, we use the `map` function to convert the input values to integers and assign them to variables A, B, and C. Then, we calculate X using the formula mentioned above and print the result.

Step 4: Test the program

Let's test the program with the given input values: A = 20, B = 10, C = 55.

Input: ``` 20 10 55 ```

Output: ``` 3 ```

According to the program, Feofilakt can buy 3 balls with the remaining money after purchasing one set of rackets.

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

0 0

Похожие вопросы

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

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

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