/*Clase Racional
*/
#include <iostream>

class Racional{
public:
  int num,den;
  Racional(){num = 0;den = 1;};
  Racional(int a){num = a;den = 1;};
  Racional(int a,int b){num = a;den = b;};
  void escribe(){std::cout << num << "/" << den << "\n";};
};

Racional& operator+(const Racional &a,const Racional &b) {
  Racional *t;
  t = new Racional();
  t->num = b.num*a.den+b.den*a.num;
  t->den = b.den*a.den;
  return *t;
}

Racional& operator-(Racional a,Racional b) {
  Racional *t;
  t = new Racional();
  t->num = a.num*b.den-a.den*b.num;
  t->den = b.den*a.den;
  return *t;
}

Racional& operator*(Racional a,Racional b) {
  Racional *t;
  t = new Racional();
  t->num = a.num*b.num;
  t->den = b.den*a.den;
  return *t;
}

Racional& operator/(Racional a,Racional b) {
  Racional *t;
  t = new Racional();
  t->num = a.num*b.den;
  t->den = b.num*a.den;
  return *t;
}

