2018年7月21日

C++编程基础二 16-习题4

摘要: 1 #pragma once 2 3 #ifndef DRUG_H_ 4 #define DRUG_H_ 5 #include 6 7 using namespace std; 8 9 enum Type 10 { 11 plusHP, 12 plusMP, 13 }; 14 15 16 struct Drug //药水属性 17 { 18 ... 阅读全文

posted @ 2018-07-21 23:58 uimodel 阅读(162) 评论(0) 推荐(0) 编辑

C++编程基础二 15-分离式编译

摘要: 1 #pragma once 2 3 #ifndef GAME_H_ 4 #define GAME_H_ 5 6 #include 7 using namespace std; 8 9 struct Game 10 { 11 string gameName; 12 string gameScore; 13 }; 14 15 void inputGame... 阅读全文

posted @ 2018-07-21 23:56 uimodel 阅读(276) 评论(0) 推荐(0) 编辑

C++编程基础二 14-函数指针

摘要: 1 // C++函数和类 14-函数指针.cpp: 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #include 6 #include 7 #include 8 #include 9 #include 10 using namespace std; 11 12 //与数据项类似,函数也有地址。函数的地址是储存其机器语... 阅读全文

posted @ 2018-07-21 23:55 uimodel 阅读(139) 评论(0) 推荐(0) 编辑

C++编程基础二 13-函数与string对象

摘要: 1 // C++函数和类 13-函数与string对象.cpp: 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #include 6 #include 7 #include 8 #include 9 #include 10 using namespace std; 11 void fill_games(string na... 阅读全文

posted @ 2018-07-21 23:54 uimodel 阅读(221) 评论(0) 推荐(0) 编辑

C++编程基础二 12-函数与结构体

摘要: 1 // C++函数和类 12-函数与结构体.cpp: 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #include 6 #include 7 #include 8 #include 9 #include 10 using namespace std; 11 12 struct WorkTime 13 { 14 ... 阅读全文

posted @ 2018-07-21 23:53 uimodel 阅读(154) 评论(0) 推荐(0) 编辑

C++编程基础二 10-函数重载

摘要: 1 // C++函数和类 10-函数重载.cpp: 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #include 6 #include 7 #include 8 #include 9 #include 10 using namespace std; 11 //如果同一个作用域内的几个函数名字相同但... 阅读全文

posted @ 2018-07-21 23:52 uimodel 阅读(132) 评论(0) 推荐(0) 编辑

C++编程基础二 11-习题3

摘要: 1 // C++函数和类 11-习题3.cpp: 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #include 6 #include 7 #include 8 #include 9 #include 10 using namespace std; 11 12 //完成程序:射击分数显示 13 //要求: 14 //1... 阅读全文

posted @ 2018-07-21 23:52 uimodel 阅读(174) 评论(0) 推荐(0) 编辑

C++编程基础二 09-constexpr函数

摘要: 1 // C++函数和类 09-constexpr函数.cpp: 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #include 6 #include 7 #include 8 #include 9 #include 10 using namespace std; 11 12 //constexpr函数:是指能用于常量... 阅读全文

posted @ 2018-07-21 23:50 uimodel 阅读(180) 评论(0) 推荐(0) 编辑

C++编程基础二 08-内联函数

摘要: 1 // C++函数和类 08-内联函数.cpp: 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #include 6 #include 7 #include 8 #include 9 #include 10 using namespace std; 11 12 //内联函数是C++为提高程序运行速度所做的一项改进。 ... 阅读全文

posted @ 2018-07-21 23:49 uimodel 阅读(122) 评论(0) 推荐(0) 编辑

C++编程基础二 06-递归函数

摘要: 1 // C++函数和类 06-递归函数.cpp: 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #include 6 #include 7 #include 8 #include 9 #include 10 11 using namespace std; 12 long fact(int i); 13 int mai... 阅读全文

posted @ 2018-07-21 23:48 uimodel 阅读(126) 评论(0) 推荐(0) 编辑

导航