Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- namespace Calculations {
- class Rational {
- private:
- int numerator;
- int denominator;
- int gcm(int, int) const;
- int lcm(int, int) const;
- public:
- Rational(int ,int );
- Rational(int);
- friend ostream &operator<<(ostream &, const Rational &);
- friend istream &operator>>(istream &, Rational &);
- int getNumerator() const;
- int getDenominator() const;
- friend Rational operator+(const Rational &, const Rational &);
- friend Rational operator-(const Rational &, const Rational &);
- friend Rational operator*(const Rational &, const Rational &);
- friend Rational operator/(const Rational &, const Rational &);
- friend Rational operator-(const Rational &);
- friend Rational operator!(const Rational &);
- // friend double static_cast<double>(liczba_starego_typu)
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement