|
|
back to boardruntime error python import sys num = str(sys.stdin.readline().split()[0]) a = int(num[:3]) b = int(num[3:]) - 1 c = int(num[3:]) + 1 sum0 = sum([int(num) for num in str(a)]) sum1 = sum([int(num) for num in str(b)]) sum2 = sum([int(num) for num in str(c)]) if abs(sum0 - sum1 == 0) or abs(sum0 - sum2 == 0) or abs(sum1 - sum0 == 0) or abs(sum2 - sum0 == 0): print("Yes") else: print("No") |
|
|