FaDaQ

Больше 5

Feb 15th, 2022 (edited)
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. numArr = []
  2. userNum = 1
  3. while userNum != 0:
  4.     userNum = int(input("Введите число: "))
  5.     numArr.append(userNum)
  6.  
  7. sum = 0
  8. for i in numArr:
  9.     if (i % 3 == 0) or (i % 4 == 0) or (i % 6 == 0):
  10.         sum += i
  11.  
  12. countMore5 = 0
  13. for i in numArr:
  14.     if int(str(i)[-1]) >= 5:
  15.         countMore5 += 1
  16.  
  17. print(f"Сумма чисел кратных 3, 4 и 6: {sum}\n"
  18.       f"Количество чисел, которые оканчиваются на цифру не менее 5: {countMore5}")
Add Comment
Please, Sign In to add comment