Using the definition
struct Rational {
int num, den;
};
write a function
Rational rational(int n, int d);
that returns an equivalent rational to and “normalized” according to: if the numerator is 0, the denominator is 1; otherwise, the numerator and the denominator do not have any common factor, and the denominator is positive.
@d@ .
You only need to submit the required classes; your main program will be ignored.
Strictly obey the type definitions of the statement.
Author: Unknown
Translator: Carlos Molina
Generation: 2026-01-25T12:06:17.460Z
© Jutge.org, 2006–2026.
https://jutge.org