Advertisement
k1alo

214124142

Apr 16th, 2024
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. total_sum = 0
  2. while True:
  3.     num = int(input("Введите натуральное число (для завершения введите 0): "))
  4.     if num == 0:
  5.         break
  6.     elif num % 6 == 0 and num % 10 == 4:
  7.         total_sum += num
  8. print("Сумма чисел, кратных 6 и оканчивающихся на 4:", total_sum)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement