blob: f95e520d9e1d39f7e58740df38efd9eaf21544a9 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
class Rational {
int numerator;
int denumerator;
public:
Rational(int numerator, int denumerator);
int get_numerator() const;
void set_numerator(int numerator);
int get_denumerator() const;
void set_denumerator(int denumerator);
void canonize();
Rational operator+(const Rational& other);
Rational operator-(const Rational& other);
Rational operator*(const Rational& other);
Rational operator/(const Rational& other);
int numcmp(const Rational& arg) const;
void print() const;
};
|