菜鸟的博客

纵有疾风起,人生不言弃。

导航

2023年5月7日 #

2023.5.7 职工管理系统

摘要: 1 //boss.h 2 #pragma once 3 #include <iostream> 4 using namespace std; 5 #include "worker.h" 6 class Boss :public Worker 7 { 8 public: 9 //构造函数 10 Bos 阅读全文

posted @ 2023-05-07 20:44 hhmzd233 阅读(28) 评论(0) 推荐(0)

2023.5.7

摘要: 1 //11-6 2 #include <iostream> 3 #include <fstream> 4 #include <string> 5 using namespace std; 6 class Dog 7 { 8 public: 9 Dog(){} 10 Dog(int age,int 阅读全文

posted @ 2023-05-07 10:15 hhmzd233 阅读(10) 评论(0) 推荐(0)

2023年5月6日 #

2023.5.6

摘要: 1 //11-3 2 #include <iostream> 3 #include <fstream> 4 using namespace std; 5 void test01() 6 { 7 ofstream ofs; 8 ofs.open("test1.txt",ios::out); 9 ofs 阅读全文

posted @ 2023-05-06 22:05 hhmzd233 阅读(13) 评论(0) 推荐(0)

2023年5月5日 #

2023.5.5

摘要: 1 //new在堆区开辟数据,手动开辟,手动释放 2 #include <iostream> 3 using namespace std; 4 //1.new的基本语法 5 int* func() 6 { 7 //new返回的是指针 8 int* p = new int(10); 9 return 阅读全文

posted @ 2023-05-05 23:03 hhmzd233 阅读(14) 评论(0) 推荐(0)

2023.5.4

摘要: 1 //#include <iostream> 2 //using namespace std; 3 //#include <fstream> 4 ////写文本文件 5 //void test01() 6 //{ 7 // //1.包含头文件 fstream 8 // //2.创建流对象 9 // 阅读全文

posted @ 2023-05-05 00:39 hhmzd233 阅读(28) 评论(0) 推荐(0)

2023年5月3日 #

2023.5.3

摘要: 1 //1.2.3函数模板案例 2 //利用函数模板封装一个排序的函数,可以对不同数据类型数组进行排序。 3 //排序规则从大到小,排序算法为选择排序 4 //分别利用char数组和int数组进行测试 5 #include <iostream> 6 using namespace std; 7 te 阅读全文

posted @ 2023-05-03 17:45 hhmzd233 阅读(11) 评论(0) 推荐(0)

2023年4月29日 #

2023.4.29

摘要: 1 //课本习题8-5 2 #include <iostream> 3 #include <string> 4 using namespace std; 5 class Mammal 6 { 7 public: 8 virtual void speak() 9 { 10 cout<<"动物正在说话" 阅读全文

posted @ 2023-04-29 18:50 hhmzd233 阅读(13) 评论(0) 推荐(0)

2023.4.28

摘要: 1 //实验六任务5 2 #include <iostream> 3 #include <string> 4 using namespace std; 5 class Student 6 { 7 public: 8 Student(int ID,string name); 9 void setnam 阅读全文

posted @ 2023-04-29 00:47 hhmzd233 阅读(21) 评论(0) 推荐(0)

2023年4月27日 #

2023.4.27

摘要: 1 //实验六任务2 2 //定义猫科动物Animal类,由其派生出猫类(Cat)和豹类(Leopard), 3 //在Animal类中定义虚函数,输出“My name is Animal”,在派生类中 4 //分别重新定义该函数,显示“My name is **”,其中**为各自类名 5 #inc 阅读全文

posted @ 2023-04-27 23:06 hhmzd233 阅读(43) 评论(0) 推荐(0)

2023.4.27

摘要: 1 //实验六任务2 2 #include <iostream> 3 #include <string> 4 using namespace std; 5 class People 6 { 7 public: 8 People(){} 9 ~People(){} 10 void setValue(i 阅读全文

posted @ 2023-04-27 20:52 hhmzd233 阅读(14) 评论(0) 推荐(0)