Write a procedure
bool read_rational(int& num, int& den);
that tries to read a rational number given in the form
“numerator”/“denominator”, and stores these two values in
@num@ and @den@, respectively. Additionally, you must remove all common
factors from @num@ and @den@. Furthermore, if the input had a rational
number, you must return true; otherwise you must returna
false. For instance, this code
int num, den;
while (read_rational(num, den)) cout << num << ' ' << den << endl;
with this input
66/12
100/100
should print
11 2
1 1
@num@ and @den@
You only need to submit the required procedure; your main program will be ignored.