scientific_comp_projects/CODE/[python]kattis/trivial/harshad_number.py

16 lines
203 B
Python
Raw Permalink Normal View History

2021-10-29 15:16:40 +02:00
n = int(input())
T = True
i = n
while T :
i = str(i)
div = 0
for j in i:
div = int(j) + div
i = int(i)
if int(i)%div == 0:
T = False
else:
i +=1
print(i)