It doesn't increase, so if you turn the loop 99 times without thinking about anything, it's OK.
N = int(input())
for _ in range(99):
N = sum(int(c) for c in str(N))
print(N)
B 1169 Row and Column and Diagonal
I can't solve it.
Recommended Posts