XJTU_Python/homework/2/9.py

5 lines
91 B
Python

x = list(map(int,input().split()))
x.sort()
a = x[0]
b = x[1]
print(round((a+b)*(b-a+1)/2))