Задание
Выбери алгоритм, который находит сумму цифр числа.
- def Digit(N):
count = 0
while N > 0:
count += 1
N //= 10
print(count)
- def Digit(N):
count = 0
while N > 0:
count += N % 2
N //= 10
print(count)
- def Digit(N):
count = 0
while N > 0:
count += N % 10
N //= 10
print(count)
- def Digit(N):
count = 0
while N > 0:
count += N % 2
N //= 2
print(count)