摘要:
Part.2 // 合并两个文件内容到一个新文件中。 // 文件名均从键盘输入 #include <iostream> #include <fstream> #include <string> #include <cstdlib> using namespace std; int main() { 阅读全文
摘要:
#include<iostream> #include<string> #include"MachinePets.h" #include"PetCats.h" #include"PetDogs.h" using namespace std; void play(MachinePets *p) { c 阅读全文
摘要:
1. 车辆基本信息管理 问题场景描述如下:为了对车量基本信息进行管理,对现实世界车量基本信息抽象后,抽象出Car类、ElectricCar类、Battery类,它们之间的关系描述如下:基于Car类派生出ElectricCar类,派生类ElectricCar中新增数据成员为Battery类对象。 #i 阅读全文
摘要:
part2 #ifndef GRAPH_H #define GRAPH_H // 类Graph的声明 class Graph { public: Graph(char ch, int n); // 带有参数的构造函数 void draw(); // 绘制图形 private: char symbol 阅读全文
摘要:
#include<iostream> #include<math.h> using namespace std; class Complex{ public: Complex(double real0=0,double imaginary0=0); Complex(Complex &p); void 阅读全文
摘要:
1. 函数重载编程练习编写重载函数add(),实现对int型,double型,Complex型数据的加法。在main()函数中定义不同类型 数据,调用测试。 #include<iostream> using namespace std; struct Complex{ double real; do 阅读全文
摘要:
2-28-1 if...else语句 #include<iostream> using namespace std; int main() { char a; cout<<"Menu:A(dd) D(elete) S(ort) Q(uit),Select one:"<<endl; cin>>a; w 阅读全文