int main(void)
{
Rational num1,num2,sum;
char ch;
cout<<"请按照\"a1/b1 a2/b2\"的格式输入两个有理数:";
cin>>num1.n>>ch>>num1.d>>num2.n>>ch>>num2.d;
sum.n=num1.n*num2.d+num2.n*num1.d;
sum.d=num1.d*num2.d;
int tmp=gcd(sum.n,sum.d);
sum.n/=tmp;
sum.d/=tmp;
cout<return 0;
}