2019年6月16日

摘要: 一、基础练习 合并文件 #include<iostream> #include<fstream> #include<string> #include<cstdlib> using namespace std; int main() { string filename1; cin>>filename1 阅读全文
posted @ 2019-06-16 13:12 LLL2 阅读(235) 评论(1) 推荐(0) 编辑

2019年6月3日

摘要: 一、没有感情的机器宠物 #include<iostream> #include<string> using std::cout; using std::endl; using std::string; class MachinePets { public: MachinePets(const str 阅读全文
posted @ 2019-06-03 23:57 LLL2 阅读(278) 评论(1) 推荐(0) 编辑

2019年5月20日

摘要: 恢复内容开始 重载运算符 << #pragma once #ifndef BATTERY_H #define BATTERY_H class battery { public: battery(int batterySize1 = 70); int getbattery()const; privat 阅读全文
posted @ 2019-05-20 15:12 LLL2 阅读(235) 评论(0) 推荐(0) 编辑

2019年4月22日

摘要: 实验三 类和对象 graph类框架 1 #ifndef GRAPH_H 2 #define GRAPH_H 3 4 // 类Graph的声明 5 class Graph { 6 public: 7 Graph(char ch, int n); // 带有参数的构造函数 8 void draw(); 阅读全文
posted @ 2019-04-22 15:11 LLL2 阅读(113) 评论(0) 推荐(0) 编辑

2019年3月31日

摘要: 运行结果: 练习总结: 1、不能只是定义,不写函数体啊!!!!!不然就会像这样 还有这样 不怪编译器……警醒自己。 2、还是要多看书复习一下,虽然写过一次,有些细节还是有点不确定。 阅读全文
posted @ 2019-03-31 15:05 LLL2 阅读(100) 评论(1) 推荐(0) 编辑
 
摘要: 2.1、c++语言概括 2.1.1)c++的产生 一个更好的c,由c演变而来 2.1.2)c++的特点 一是尽量兼容c,二是支持面向对象的方法。更安全,且简洁高效。 2.1.3~2.1.5 多数和C相同,数据太多,看书p20-p23 2.2 、基本数据类型和表达式 基本与C相同,bool类型常量 只 阅读全文
posted @ 2019-03-31 14:58 LLL2 阅读(107) 评论(0) 推荐(0) 编辑

2019年3月25日

摘要: 重载函数 #include<iostream> using namespace std; struct Complex { double real; double imaginary; }; int add(int ,int ); double add(double ,double ); Compl 阅读全文
posted @ 2019-03-25 23:13 LLL2 阅读(123) 评论(0) 推荐(0) 编辑

2019年3月17日

摘要: 实验代码及运行结果 实验2-28 if else 语句 switch语句 2-29 while语句 do while for 2-32 while do while 2-34 多少种取法 #include<iostream> using namespace std; int jc(int); int 阅读全文
posted @ 2019-03-17 19:36 LLL2 阅读(168) 评论(6) 推荐(0) 编辑