#include "stdafx.h"
#include "iostream"
using namespace std;
class B
{
private:
int bx, by;
public:
B(int i, int j);
friend class A;
};
B::B(int i, int j)
{
bx = i;
by = j;
}
class A
{
private:
int ax, ay;
public:
A(int i, int j)
friend int sum(A);
int sumB(B b);
};
A::A(int i, int j)
{
ax = i;
ay = j;
}
int sum(A a)
{
return (a.ax + a.ay);
}
int A::sumB(B b)
{
return (b.bx + b.by);
}
int main()
{
B b(3, 8);
A a(5.10);
cout << sum(a) << endl;
cout << a.sumB(b) << endl;
//cout << "hahah" << endl;
return 0;
}