Вопрос задан 08.08.2018 в 21:55. Предмет Информатика. Спрашивает Мирасова Айдина.

N школьников делят K яблок поровну, неделящийся остаток остается в корзинке. Сколько яблок

останется в корзинке? На питоне пжлст
0 0
Перейти к ответам

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

Внимание! Ответы на вопросы дают живые люди. Они могут содержать ошибочную информацию, заблуждения, а также ответы могут быть сгенерированы нейросетями. Будьте внимательны. Если вы уверены, что ответ неверный, нажмите кнопку "Пожаловаться" под ответом.
Отвечает Новикова Катя.
Это тебя интересует?-
//Pascal ABC.NET 3.1 сборка 1256

Var
 n,k:integer;
begin
read(n,k);
writeln(k mod n);
end.

Пример ввода:
3
14
Пример вывода:
2

Или это?
n = int(input())k = int(input())x = k // ny = k - (x * n)print(x)print(y)
0 0
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

Solving the Problem

To solve the problem of dividing N apples among K students and finding the remaining apples, we can use the modulo operator in Python.

The formula to find the remaining apples is: Remaining Apples = N % K

Let's calculate the remaining apples using this formula.

```python # Given values N = 20 # Number of apples K = 6 # Number of students

# Calculate remaining apples remaining_apples = N % K print(remaining_apples) # Output: 2 ```

So, if 20 apples are divided among 6 students, 2 apples will remain in the basket.

Explanation

When we divide the number of apples (N) by the number of students (K) using the modulo operator (%), the result is the remainder, which represents the number of apples remaining in the basket after they have been equally distributed among the students.

In this case, when 20 apples are divided among 6 students, 2 apples will remain in the basket.

Feel free to ask if you have further questions or need additional assistance!

0 0

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

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

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