fork download
  1. a=input()
  2. b,c=map(int,a.split('/'))
  3. e=input()
  4. f,g=map(int,e.split('/'))
  5. if c==0 or g==0 :
  6. print("Flase")
  7. else:
  8. s=(b*g)+(c*f)
  9. m=c*g
  10. for i in range(1,10):
  11. if s%i==0 and m%i==0:
  12. x=s/i
  13. y=m/i
  14. print(f"{x}/{y}")
  15. else:
  16. print(f"{s}/{m}")
Success #stdin #stdout 0.02s 9392KB
stdin
1/2
2/3
stdout
7.0/6.0
7/6
7/6
7/6
7/6
7/6
7/6
7/6
7/6