The Easiest Problem Is This One
This commit is contained in:
19
easiest.py
Normal file
19
easiest.py
Normal 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())
|
||||
Reference in New Issue
Block a user