02 2021 档案
摘要:声明一个circle类,有数据成员Radius(半径float型),成员函数GetArea()计算圆的面积。在main 函数中声明一个circle类的对象c1,其半径为5.6。调用GetArea()函数计算c1的面积,并显示该计算 结果(cout<<"圆的面积:"<<c1.GetArea()<<en
阅读全文
摘要:源程序: #include <iostream>using namespace std;class Sample{ int n; static int sum;public: Sample(int x) { n = x; } void add() { sum += n; } void disp()
阅读全文
摘要:源程序: #include <iostream>using namespace std;class Sample{private: int x;public: Sample() {} Sample(int a) { x = a; } void disp() { cout << "x=" << x <
阅读全文
摘要:源程序: #include <iostream>using namespace std;class Sample{private: int x;public: Sample() {} Sample(int a) { x = a; } void disp() { cout << "x=" << x <
阅读全文