The Easiest Problem Is This One

This commit is contained in:
2023-07-16 21:51:59 +02:00
parent 95979cdcf0
commit 910504b0d7

19
easiest.py Normal file
View File

@@ -0,0 +1,19 @@
def sumOfDigits(n: int) -> int:
sod = 0
while True:
sod += n % 10
n = n // 10
if n == 0:
return sod
n = int(input())
while n:
sodn = sumOfDigits(n)
p = 11
while True:
if sodn == sumOfDigits(n * p):
print(p)
break
p += 1
n = int(input())