Python3 代码
while True:
n = input().split()
x = int(n[0])
y = int(n[1])
if x <= 0 or y <= 0:
break
if x > y:
x, y = y, x
sum = 0
for i in range (x, y + 1):
sum += i
print (i, end=" ")
print ("Sum=" + str(sum))