#include <stdio.h>
int main(void) {
int a,b,c,d,r1,r2;
printf("Enter two fractions separated by a plus sign:");
scanf("%d/%d%d/%d", &a, &b, &c, &d);
r1=a*d+b*c;
r2=b*d;
printf("The sum is %d/%d", r1, r2);
return 0;
}
//Input Data:
//9/28+-20/17
//Except:
//Enter two fractions separated by a plus sign:The sum is -407/476
//Actual result:
//Enter two fractions separated by a plus sign:The sum is 28/0