欢迎光临散文网 会员登陆 & 注册

ddd

2023-03-30 20:37 作者:bili_49463418430  | 我要投稿

#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:"<

ddd的评论 (共 条)

分享到微博请遵守国家法律