- 博客(10)
- 资源 (3)
- 收藏
- 关注
原创 c++设计模式之建造者模式
#define _CRT_SECURE_NO_WARNINGS#include <iostream>#include <string.h>using namespace std;class House {public: void setDoor(string m_door) { this->m_door = m_door; } string getDoor() { return m_door; } void setWall(string m_
2022-04-21 08:39:52
232
原创 c++设计模式之抽象工厂模式
#define _CRT_SECURE_NO_WARNINGS#include <iostream>#include <string.h>using namespace std;class Fruit {public: virtual void getFruit() = 0;};class AbFactory {public: virtual Fruit* CreateAppleProduct() = 0; virtual Fruit* CreateBan
2022-04-20 11:09:04
438
原创 C++设计模式之工厂模式
#define _CRT_SECURE_NO_WARNINGS#include<iostream>#include <string.h>using namespace std;class Fruit{public: virtual void getFruit() = 0;};class Apple : public Fruit {public: void getFruit() { cout << "我是苹果" << endl;
2022-04-20 08:28:43
820
原创 C++设计模式之单例模式
#define _CRT_SECURE_NO_WARNINGS#include <iostream>#include <stdlib.h>#include <windows.h>using namespace std;#if 1/** * 懒汉式 */class Singelton {public: static Singelton * getInstance() { if (m_sig == NULL) { m_sig = n
2022-04-19 09:33:06
594
原创 c语言求一个数组最大值与最小值
int getMaxMin(int *arr,int len,int flag){ int max = arr[0]; int min = arr[0]; if (flag == 1) { for (int i = 0; i < len; ++i) { if (arr[i] > max) { max = arr[i]; }
2021-10-14 08:11:50
3981
2
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人