摘要:
#include<bits/stdc++.h> using namespace std; class Dog { private: int weight,age; public: Dog(int w,int a):weight(w),age(a) { } int getw() { return we 阅读全文
摘要:
1、复数类Complex有两个数据成员:a和b, 分别代表复数的实部和虚部,并有若干构造函数和一个重载-(减号,用于计算两个复数的距离)的成员函数。 要求设计一个函数模板 template < class T > double dist(T a, T b) 对int,float,Complex或者其 阅读全文