摘要: 【实验结论】 #Part1 #include <iostream> #include <fstream> #include <string> #include <cstdlib> using namespace std; int main() { string filename1, filename 阅读全文
posted @ 2019-06-11 17:45 一朵毛毛 阅读(239) 评论(0) 推荐(0) 编辑
摘要: #宠物 #include<iostream> #include<string> #include<cstdlib> using namespace std; #ifndef MACHINEPETS_H #define MACHINEPETS_H class MachinePets { public: 阅读全文
posted @ 2019-06-03 23:06 一朵毛毛 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 【实验结论】 #1.车辆基本信息管理 #ifndef BATTERY_H #define BATTERY_H class Battery { public: Battery(int batterSize0=70); int getbatterysize(); ~Battery(); private: 阅读全文
posted @ 2019-05-14 17:45 一朵毛毛 阅读(599) 评论(4) 推荐(0) 编辑
摘要: 【实验结论】 #1.在画布上可以上下左右移动的小球 #ifndef BALL_H #define BALL_H class Ball { public: Ball(int x0=0, int y0=0); // 在坐标(x,y)处构造一个小球(小球用字符O表示) void move(); //小球移 阅读全文
posted @ 2019-04-19 21:15 一朵毛毛 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 【实验结论】 #Complex.h #main [运行结果] 【实验总结】 本来是想着用结构体定义类的,但是发现main函数里给出的输入比较适合用普通类,用结构体的话定义成员函数时大概想了一下,会比较麻烦,所以最后就没用结构体了。 还有一个小问题,就是“Complex c2=4.5”Dev-C++编 阅读全文
posted @ 2019-03-30 16:49 一朵毛毛 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 【实验结论】 #函数重载 编写重载函数add(),实现对int型,double型,Complex型数据的加法。在main()函数中定义不同类型 数据,调用测试。 [运行结果] #函数模板 编写实现快速排序函数模板,并在main()函数中,定义不同类型数据,调用测试。 ·Pivotkey.h定义 ·Q 阅读全文
posted @ 2019-03-20 12:44 一朵毛毛 阅读(558) 评论(4) 推荐(0) 编辑
摘要: 【实验结论】 #2-28 实现一个简单的菜单程序,运行时显示“Menu:A(dd) D(elete) S(ort) Q(uit),Selete one:”提示用户输入。A表示增加,D表示删除,S表示排序,Q表示退出。输入为A、D、S时分别提示“数据已经增加、删除、排序。”,输入Q时程序结束。 (1) 阅读全文
posted @ 2019-03-14 22:14 一朵毛毛 阅读(620) 评论(4) 推荐(0) 编辑