#include <iostream>
using namespace std;
class car;
class boat
{
public:
boat(int weight)
{
this->weight = weight;
}
friend int getTotalWeight(boat &b,car &c);
private:
int weight;
};
class car
{
public:
car(int weight)
{
this->weight = weight;
}
friend int getTotalWeight(boat &b,car &c);
private:
int weight;
};
int getTotalWeight(boat &b,car &c)
{
return b.weight+c.weight;
}
int main()
{
boat b(3);
car c(2);
cout<<"总重量是"<<getTotalWeight(b,c)<<endl;
return 0;
}