#include
using namespace std;
?
class car;
class boat{
private:
int weight;
public:
boat(int w){weight = w;}
friend int gettotalweight(boat &b, car &c);
};
?
class car{
private:
int weight;
public:
car(int w){weight = w;}
friend int gettotalweight(boat &b, car &c);
};
?
int gettotalweight(boat &b, car &c){
return b.weight+c.weight;
}
int main()
{
boat b1(5);
car c2(2);
cout<<"Totalweight:"<標簽: