Advertisement
Gowwa

Untitled

Jul 16th, 2019
1,047
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def hicelku():
  2.     h = int(input("Ведите первое натуральное число: "))
  3.     v = int(input("Введите второе натуральное число: "))
  4.     b = h
  5.     g = v
  6.     sum1 = 0
  7.     sum2 = 0
  8.     while h > 0:
  9.         sum1 += h % 10
  10.         h //= 10
  11.     while v > 0:
  12.         sum2 += v % 10
  13.         v //= 10
  14.     if sum1 > sum2:
  15.         print(b)
  16.     else:
  17.         print(g)
  18. hicelku()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement