7-3 sdut-分数加减法
from fractions import Fraction as F
while True:
try:
a = input()
if a.find('+')!=-1:
ls = a.split('+')
print(F(ls[0]) + F(ls[1]))
elif a.find('-')!=-1:
ls = a.split('-')
print(F(ls[0]) - F(ls[1]))
elif a.find('*')!=-1:
ls = a.split('*')
print(F(ls[0]) * F(ls[1]))
else:
ls = a.split('\\')
print(F(ls[0]) / F(ls[1]))
except:
break