Week 10: January 18 - 24
Fractions: addition and subtraction
Two fractions are given. Find their sum or difference.
Each line contains an example of addition or subtraction of fractions. The numerator and denominator of each fraction is a positive integer, not greater than
For each input example, print in a separate line the answer in the form of an irreducible fraction. If the answer is negative, a minus sign in front of the fraction should be printed.
1/2 + 3/4 4/5 - 7/3 3/2 + 5/6 7/6 - 1/6 3/2 - 3/2
5/4 -23/15 7/3 1/1 0/1