• Предмет: Информатика
  • Автор: nastyawxs
  • Вопрос задан 3 месяца назад

‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️Розвʼяжи задачу:
А) Графічним способом (блок-схема);
Б) Створи код в інтерактивній оболонці Pvthon

Вкошику лежать Аяблук. їх потрібно поділити між N учнями, якщо учнів більше, ніж яблук, то написати, що яблук не вистачає.

Підказка:
ввести кількість яблук
ввести кількість учнів
якщо учнів більше, ніж яблук, то
написати, що яблук не вистачає
‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️‼️

Ответы

Ответ дал: maybeh9ije
0

Блок схема apples = int(input("Enter the number of apples: "))

students = int(input("Enter the number of students: "))

if students > apples:

print("Not enough apples")

else:

apples_per_student = apples // students

print("Each student will get", apples_per_student, "apples")

Start <Phyton

|

V

Enter the number of apples (apples)

Enter the number of students (students)

|

V

If students > apples, then

Display "Not enough apples"

Else

Divide apples by students and assign the result to a variable (apples_per_student)

Display "Each student will get", apples_per_student, "apples"

End

Вас заинтересует