上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 54 下一页
该文被密码保护。 阅读全文
posted @ 2020-06-23 23:05 bobo哥 阅读(0) 评论(0) 推荐(0)
摘要: 抽象类-编写一个程序,用于计算正方形、矩形、直角三角形和圆的面积之和。 源程序: //纯虚函数与抽象类#include <iostream>using namespace std;class shape //shape类中有纯虚函数,所以shape是抽象类,抽象类定义的对象也是抽象的,只能用指针对象 阅读全文
posted @ 2020-06-16 23:42 bobo哥 阅读(165) 评论(0) 推荐(0)
摘要: 请编写一个抽象类shape,在此基础上派生出类Rectangle和Circle,两者都有计算面积的函数GetArea()、计算对象周长的函数GetPerim()。 抽象类 源程序: #include<iostream> #define PI 3.1415926; using namespace st 阅读全文
posted @ 2020-06-16 23:32 bobo哥 阅读(191) 评论(0) 推荐(0)
摘要: 多态的实现 源程序: #include <iostream> #include <cmath> using namespace std; class CShape { protected: double acreage; public: CShape() { //cout<<"基类构造函数"<<en 阅读全文
posted @ 2020-06-16 23:19 bobo哥 阅读(125) 评论(0) 推荐(0)
摘要: 源程序: #include <iostream>#include <algorithm>#include <functional>#include <iomanip>#include <stdlib.h>const int MAXSIZE = 10;using namespace std; int* 阅读全文
posted @ 2020-06-14 21:45 bobo哥 阅读(124) 评论(0) 推荐(0)
摘要: 源程序: 头函数:menu.h #pragma once#if!(menu_H)#define menu_h#include <iostream>using namespace std; class calc{private: int a, b; int p, m;public: calc() {} 阅读全文
posted @ 2020-06-14 21:43 bobo哥 阅读(167) 评论(0) 推荐(0)
摘要: 源程序: #include <iostream>#include <stdlib.h>const int MaxSize = 8;using namespace std; typedef struct{ int stuno; string stuname; int stuage;}TableElem 阅读全文
posted @ 2020-06-14 21:37 bobo哥 阅读(134) 评论(0) 推荐(0)
摘要: 源程序: #include <iostream>#include <string>#define N 4using namespace std; class student{private: int num; string name; string sex; int age;public: stud 阅读全文
posted @ 2020-06-14 21:34 bobo哥 阅读(151) 评论(0) 推荐(0)
摘要: menu.h #pragma once#include <stdio.h>#include <stdlib.h>#if!defined(menu_H)#define menu_h //定义单链表结点类型typedef struct node{ int data; struct node* next; 阅读全文
posted @ 2020-06-13 12:35 bobo哥 阅读(76) 评论(0) 推荐(0)
摘要: 头函数1:point.h #pragma once#if!defined(point_H)#define point_h#define PI 3.1415926#include <iostream>using namespace std; //定义基类class Point{private: int 阅读全文
posted @ 2020-06-08 13:27 bobo哥 阅读(124) 评论(0) 推荐(0)
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 54 下一页