2018年7月30日

C++Primer Plus 编程练习_第五章

摘要: #pragma once #include "stdafx.h" #ifndef CHAPTER5_H_ #define CHAPTER5_H_ #include #include #include using namespace std; //1. class Exercise1 { private: int num1_; int num2_; public: ... 阅读全文

posted @ 2018-07-30 16:40 uimodel 阅读(584) 评论(0) 推荐(0) 编辑

2018年7月26日

C++Primer Plus 编程练习_第四章

摘要: #pragma once #ifndef CHAPTER4_H_ #define CHAPTER4_H_ #include #include #include using namespace std; //1&2 struct memberInfo1; class Exercise1 { private: public: void inputInfo1(); ... 阅读全文

posted @ 2018-07-26 13:50 uimodel 阅读(840) 评论(0) 推荐(0) 编辑

2018年7月23日

C++Primer Plus 编程练习_第三章

摘要: 1 #pragma once 2 #ifndef CHAPTER3_H_ 3 #define CHAPTER3_H_ 4 #include 5 #include 6 7 using namespace std; 8 9 class Exercise1 10 { 11 private: 12 const int factor = 12; 13 public: 14... 阅读全文

posted @ 2018-07-23 14:03 uimodel 阅读(549) 评论(0) 推荐(0) 编辑

C++Primer Plus 编程练习_第二章

摘要: 1 #pragma once 2 #ifndef CHAPTER2_H_ 3 #define CHAPTER2_H_ 4 #include 5 using namespace std; 6 7 class Exercise1 8 { 9 private: 10 string name_; 11 string address_; 12 public: 13 ... 阅读全文

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

2018年7月22日

C++编程基础二 28-复习2

摘要: 1 // C++函数和类 28-复习2.cpp: 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #include 6 #include 7 8 using namespace std; 9 10 //定义类,class关键字 类名 11 //类的数据成员(私有private),类的成员方法(公有publi... 阅读全文

posted @ 2018-07-22 00:04 uimodel 阅读(125) 评论(0) 推荐(0) 编辑

C++编程基础二 27-复习1

摘要: 1 // C++函数和类 27-复习1.cpp: 定义控制台应用程序的入口点。 2 // 3 4 #include "stdafx.h" 5 #include 6 #include 7 8 using namespace std; 9 10 //函数原型 11 int max(int num1, int num2); 12 //默认参数 13 int max(int ... 阅读全文

posted @ 2018-07-22 00:04 uimodel 阅读(125) 评论(0) 推荐(0) 编辑

C++编程基础二 26-习题5

摘要: 1 #pragma once 2 #ifndef DRUG_H_ 3 #define DRUG_H_ 4 #include 5 using namespace std; 6 7 enum Type 8 { 9 PlusHP, 10 PlusMP 11 }; 12 13 class Drug 14 { 15 private: 16 string na... 阅读全文

posted @ 2018-07-22 00:03 uimodel 阅读(230) 评论(0) 推荐(0) 编辑

C++编程基础二 23-对象数组

摘要: 1 #pragma once 2 #ifndef ARRAY_H_ 3 #define ARRAY_H_ 4 5 class Calculator 6 { 7 private: 8 float number1_; 9 float number2_; 10 11 public: 12 Calculator(float num1,float nu... 阅读全文

posted @ 2018-07-22 00:02 uimodel 阅读(135) 评论(0) 推荐(0) 编辑

C++编程基础二 22-this指针

摘要: 1 #pragma once 2 3 #ifndef CUBOID_H_ 4 #define CUBOID_H_ 5 6 7 class Cuboid 8 { 9 private: 10 double length_; 11 double width_; 12 double height_; 13 public: 14 Cuboid(dou... 阅读全文

posted @ 2018-07-22 00:01 uimodel 阅读(170) 评论(0) 推荐(0) 编辑

2018年7月21日

C++编程基础二 20-类对象的声明和使用

摘要: 1 #pragma once 2 #ifndef STUDENT_ 3 #include 4 #include 5 6 using namespace std; 7 8 #endif // !STUDENT_ 9 10 //类的声明 11 class Student 12 { 13 private: 14 //Student类的友元函数,但是不是这个类的函数... 阅读全文

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

导航