摘要: Part2 #include <iostream> #include <fstream> #include <string> #include <cstdlib> using namespace std; int main() { string filename1, filename2, newfi 阅读全文
posted @ 2019-06-18 12:03 景行ai 阅读(140) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <string> using namespace std; class MachinePets{ public: MachinePets(const string s):nickname(s){}; string getNickname(); 阅读全文
posted @ 2019-06-03 22:30 景行ai 阅读(110) 评论(2) 推荐(0) 编辑
摘要: #ifndef BATTERY_H #define BATTERY_H class Battery { public: Battery(int batterySize0=70); int showbattery()const; int batterySize; }; #endif #include" 阅读全文
posted @ 2019-05-20 17:58 景行ai 阅读(166) 评论(1) 推荐(0) 编辑
摘要: Part2 #ifndef GRAPH_H #define GRAPH_H // 类Graph的声明 class Graph { public: Graph(char ch, int n); // 带有参数的构造函数 void draw(); // 绘制图形 private: char symbol 阅读全文
posted @ 2019-04-22 23:13 景行ai 阅读(139) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<cmath> using namespace std; class Complex{ public: Complex(double x,double y); Complex(Complex &a); void add(Complex a); v 阅读全文
posted @ 2019-04-01 21:43 景行ai 阅读(113) 评论(1) 推荐(0) 编辑
摘要: 一、函数重载编程练习 编写重载函数add(),实现对int型,double型,Complex型数据的加法。在main()函数中定义不同类型数据,调用测试。 #include<iostream> using namespace std; struct complex{ double real; dou 阅读全文
posted @ 2019-03-26 13:11 景行ai 阅读(205) 评论(2) 推荐(0) 编辑
摘要: 实验结论2-28 第一种方法使用while #include<iostream> using namespace std; int main(){ char i; cout<<"Menu:A(dd) D(elete) S(ort) Q(uit),Select one:"<<endl; while(1 阅读全文
posted @ 2019-03-18 22:10 景行ai 阅读(214) 评论(2) 推荐(0) 编辑