Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def summ(x):
- s = 0
- for i in range(len(str((x)))):
- s += x % 10
- x = x // 10
- return s
- x = int(input())
- c1 = x
- n1 = summ(x)
- x = int(input())
- c2 = x
- n2 = summ(x)
- if n1 > n2:
- print ("Сумма цифр в числе", c1, " больше")
- elif n2 > n1:
- print ("Сумма цифр в числе",c2, "больше")
- else:
- print("Сумма одинакова")
Advertisement
Add Comment
Please, Sign In to add comment