赞
踩
from fractions import Fraction
n=int(input())
s=0
for i in input().split():
a,b=map(int,i.split('/'))
s+=Fraction(a,b)
if s.numerator>s.denominator and s!=int(s):
print(s.numerator//s.denominator,Fraction(s.numerator-(s.numerator//s.denominator*s.denominator),s.denominator))
else:
print(s)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。