Skip to content

Commit c75f02c

Browse files
Update Q6.cpp
1 parent 1ca8018 commit c75f02c

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

week4/Q6.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,11 @@ class Rational
2323
return denomanator;
2424
}
2525

26-
friend Rational operator+(const Rational &left, int right);
27-
// Bfriend ostream operator << (ostream&out, const Rational& object);
28-
friend ostream &operator<<(ostream &out, const Rational &object);
26+
friend Rational &operator+(const Rational &left, int right);
2927

30-
// friend void display(ostream& out, const Rational& value) {}
28+
friend ostream &operator<<(ostream &out, const Rational &object);
3129

32-
// friend bool operator < (const Rational& left, const Rational& right);
30+
3331
friend bool operator<(int a, const Rational &left)
3432
{
3533
if (a < left)
@@ -40,11 +38,7 @@ class Rational
4038
return true;
4139
}
4240

43-
// friend Rational operator+( const Rational& left, int right){}
44-
45-
// friend void operator+ ( const Rational& left, int right){}
46-
47-
// friend void operator+ (const Rational&left, int right) {}
41+
4842

4943
private:
5044
int numerator;

0 commit comments

Comments
 (0)