上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 54 下一页
摘要: 原图 阅读全文
posted @ 2021-03-18 19:25 bobo哥 阅读(62) 评论(0) 推荐(0)
摘要: 声明一个circle类,有数据成员Radius(半径float型),成员函数GetArea()计算圆的面积。在main 函数中声明一个circle类的对象c1,其半径为5.6。调用GetArea()函数计算c1的面积,并显示该计算 结果(cout<<"圆的面积:"<<c1.GetArea()<<en 阅读全文
posted @ 2021-02-10 18:48 bobo哥 阅读(336) 评论(2) 推荐(0)
摘要: 源程序: #include <iostream>using namespace std;class Sample{ int n; static int sum;public: Sample(int x) { n = x; } void add() { sum += n; } void disp() 阅读全文
posted @ 2021-02-10 18:40 bobo哥 阅读(102) 评论(0) 推荐(0)
摘要: 源程序: #include <iostream>using namespace std;class Sample{private: int x;public: Sample() {} Sample(int a) { x = a; } void disp() { cout << "x=" << x < 阅读全文
posted @ 2021-02-10 18:34 bobo哥 阅读(139) 评论(0) 推荐(0)
摘要: 源程序: #include <iostream>using namespace std;class Sample{private: int x;public: Sample() {} Sample(int a) { x = a; } void disp() { cout << "x=" << x < 阅读全文
posted @ 2021-02-10 17:49 bobo哥 阅读(166) 评论(0) 推荐(0)
摘要: 源程序 #include <iostream>using namespace std;void main(){ int a[6]={23,15,64,33,40,58}; int s1,s2; s1=s2=a[0]; for(int *p=a+1;p<a+6;p++) { if(s1 > *p) s 阅读全文
posted @ 2021-01-30 13:20 bobo哥 阅读(287) 评论(0) 推荐(0)
摘要: 设计一个圆类circle和一个桌子类table。circle类包含私有数据成员radius和求圆面积的成员函数getarea();table类包含私有数据成员height和返回高度的成员函数getheight()。roundtable类继承所有上述类的数据成员和成员函数,添加了私有数据成员color 阅读全文
posted @ 2021-01-30 13:17 bobo哥 阅读(151) 评论(0) 推荐(0)
摘要: 源程序: class Point{ int x,y; Point(int a,int b) { x=a; y=b; } void show() { System.out.print(x+" "); System.out.print(y+" "); System.out.println(); //换行 阅读全文
posted @ 2020-12-29 20:56 bobo哥 阅读(134) 评论(0) 推荐(1)
摘要: 源程序: #include <iostream>using namespace std; class Base1{public: Base1() { b1=6; } Base1(int i) { b1=i; } int get1() { return b1; }private: int b1;}; 阅读全文
posted @ 2020-12-28 21:04 bobo哥 阅读(100) 评论(0) 推荐(0)
摘要: 源程序: #include <iostream>using namespace std;class Point{private: int X,Y;public: Point(int a=0,int b=0) { X=a; Y=b; cout<<"Initializing……"<<endl; } Po 阅读全文
posted @ 2020-12-28 20:13 bobo哥 阅读(200) 评论(0) 推荐(0)
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 54 下一页