forked from natto1784/ooplab
34 lines
411 B
C++
34 lines
411 B
C++
#include <algorithm>
|
|
#include <iostream>
|
|
using namespace std;
|
|
|
|
class Foo;
|
|
class Bar;
|
|
|
|
class Foo {
|
|
private:
|
|
int foo;
|
|
|
|
public:
|
|
Foo(int n) { foo = n; }
|
|
friend int bigger(Foo, Bar);
|
|
};
|
|
|
|
class Bar {
|
|
private:
|
|
int bar;
|
|
|
|
public:
|
|
Bar(int n) { bar = n; }
|
|
friend int bigger(Foo, Bar);
|
|
};
|
|
|
|
int bigger(Foo a, Bar b) { return max(a.foo, b.bar); }
|
|
|
|
int main() {
|
|
Foo a(5);
|
|
Bar b(55);
|
|
|
|
cout << bigger(a, b);
|
|
}
|