- 博客(29)
- 资源 (6)
- 收藏
- 关注
转载 排序比较好的文章
快速排序算法http://blog.youkuaiyun.com/lemon_tree12138/article/details/50622744堆排序https://www.cnblogs.com/Kevin-mao/p/5903234.html选择排序和优化http://blog.youkuaiyun.com/peiyao456/article/details/53240482希尔排序https://www.cnbl...
2018-03-16 14:20:24
422
原创 WSAEventSelect服务端
// 下载地址 https://download.youkuaiyun.com/download/u010907036/10284533// InitSocket.h#pragma once#include <WinSock2.h>#include <string>using namespace std;class InitSocket{private: // 通信端口 int m_n...
2018-03-13 17:32:30
258
原创 使用OD从零开始Cracking
CrueHead’a的CrackMe 注册机// ConsoleApplication23.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include using namespace std;int main(){string name;cin >> name;int le
2017-01-25 14:54:38
1199
原创 使用olldbg从入门到精通之splish注册机代码
// ConsoleApplication20.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include using namespace std;int main(){string name;cin >> name;string seri;//cin >> seri;int
2017-01-23 21:35:07
532
原创 Hook自定义MessageBox
// HookMsgBox.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include "windows.h"#include #include using namespace std;// MessageBoxW函数原型// int WINAPI MessageBoxW(__in_opt HWND hWnd,__in_opt LPCWS
2016-09-18 16:44:12
1025
原创 c++ 写注册表 并将exe添加到开机启动
// CreateRegedit.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ HKEY hPrimaryKey = HKEY_LOCAL_MACHINE; TCHA
2016-02-21 21:18:03
916
原创 c++ 读注册表信息 读取CPU信息
// regedit_find.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include using namespace std;const int BUFFER_SIE = 1000;int _tmain(int argc, _TCHAR* argv[]){ long lRet; HKEY
2016-02-21 20:21:40
553
原创 Chartpter1 Install the MASM32 SDK
Authour:Wei.JiangCreateTime:2016/2/16 一.Install the MASM32 SDKPls Download it from www.masm32.com.This is a compression software. Open it and just DoubleClick the install.exe.After selecting
2016-02-16 19:17:12
563
原创 c++中介者模式
#include "stdafx.h"#include #include using namespace std;typedef string State;class Colleague;class Mediator{public: virtual void AToB() = 0; virtual void BToA() = 0; virtual void IntroC
2015-10-21 21:24:52
409
原创 c++代理模式
#include "stdafx.h"#include using namespace std;class Subject{public: virtual void display() = 0;};class ConcreteSubject:public Subject{public: void display() {coutdisplay(); } ~Proxy() {delete m_pSub
2015-10-09 23:17:36
401
原创 c++享元模式
#include "stdafx.h"#include #include #include #include #include using namespace std;enum Color {WHITE, BLACK, GRAY};struct Position{ int cx; int cy;};bool cmp(const Position& Fist, con
2015-10-06 12:10:00
440
原创 c++装饰模式
#include "stdafx.h"#include #include using namespace std;class Component{public: virtual void Method() = 0;};class ConcreteComponent:public Component{public: void Method();};void Con
2015-10-05 13:43:56
378
原创 c++组合模式和原型模式一起使用
#include "stdafx.h"#include #include using namespace std;class Component{public: virtual Component* clone() = 0; virtual void operation() = 0; virtual void Add(Component* pComponent) {} vir
2015-10-04 23:46:40
404
原创 c++外观模式
#include "stdafx.h"#include using namespace std;class FunA{public: void display() {cout<<"FunA is working"<<endl;}};class FunB{public: void display() {cout<<"FunB is working"<<endl;}};
2015-10-04 13:10:55
638
原创 c++桥接模式
#include "stdafx.h"#include using namespace std;class SoftWare{public: virtual void display() = 0;};class SoftWareA:public SoftWare{ void display() {cout<<"soft a was finished"<<endl;}};
2015-10-04 12:06:10
455
原创 c++原型模式
#include "stdafx.h"#include using namespace std;class Prototype{public:virtual Prototype* clone() const = 0;virtual int GetScore() const = 0;virtual void SetScore(int& temp) =
2015-10-04 10:43:41
342
原创 c++建造者模式
// ConsoleApplication1.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include <iostream>//#include "Factory.h"using namespace std;class Man{public: Man():flag(
2015-10-04 10:40:22
419
原创 c++对象适配器
// ConsoleApplication1.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include //#include "Factory.h"using namespace std;class Target{public
2015-10-03 17:04:15
443
原创 c++类适配器
// ConsoleApplication1.cpp : Defines the entry point for the console application.//Target生成对象是合理的,so不用纯虚函数#include "stdafx.h"#include //#include "Factory.h"using namespace std;
2015-10-03 16:57:28
397
原创 c++抽象工厂模式
// ConsoleApplication1.cpp : Defines the entry point for the console application.// 这是违背开放封闭原则的:增加产品需修改工厂类#include "stdafx.h"#include //#include "Factory.h"using namespace std;
2015-10-02 22:01:56
533
原创 c++工厂模式
//解决了简单工厂模式违背了开闭原则的问题// ConsoleApplication1.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include //#include "Factory.h"using namespace std;
2015-10-02 17:44:23
652
原创 c++简单工厂模式
// ConsoleApplication1.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include //#include "Factory.h"using namespace std;class Product{p
2015-10-01 21:17:33
373
原创 c++单例模式(线程安全)
1.构造函数为private,生成对象的时候,编译器调用构造函数属于外部调用。2.构造函数为private不能被继承,因为当其子类初始化的时候需要调用构造函数,但此时构造函数为private,不能被调用。所以,该类只有一个实例。静态实例初始化在程序开始时进入主函数之前就由主线程以单线程方式完成了初始化,不必担心多线程问题。
2015-10-01 16:39:49
426
原创 链表逆置
#includeusing namespace std;struct Node{int data;Node *next;};int main(){int n;while(cin>>n){int i;Node *root=new Node;Node *r=root;int x;for(i=0;i{Node *p=
2015-03-26 21:19:30
788
原创 约瑟夫环输出出队的人的序号,数组模拟
#include #include int peoples[100]; int main(void){ int people_count = 0; printf("请输入总人数: "); scanf("%d", &people_count); int m;//每隔m个人就淘汰一个 printf("\n每隔多少个
2014-07-01 18:53:40
2657
原创 单链表的一些操作
#includeusing namespace std;typedef char elemtype;//以char型为例struct Node{ elemtype data; Node *next;};Node *Create_W();//使用尾插法建立单链表Node *Create_T();//使用头插法每次新节点总是作为首元节点插入在链表的头节点之后。
2014-03-06 21:58:49
494
原创 二叉树入门(对称二叉树)
#include#include#define N 110//定义宏并非多此一举,建议善用宏using namespace std;char str[N];int len;//字符串的长度struct BTreeNode{ char data;//data的类型依题意而定 BTreeNode *lchild; BTreeNode *rchild;};BTreeNo
2014-03-05 21:05:47
1152
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人