- 博客(6)
- 收藏
- 关注
原创 c++ 代理模式
#include <iostream> #include <string> using namespace std; class GiveGift { public: virtual void giveDolls(){}; virtual void giveFlowers(){}; virtual void giveChocolat...
2014-11-30 23:23:00 67
原创 c++ 装饰模式
#include <iostream> #include <string> using namespace std; class Person { public: Person() { } Person(string nameStr) { this->name = nameStr;...
2014-11-30 22:37:00 160
原创 c++ 策略模式
#include <iostream> using namespace std; // 现金收费抽象类 class CashSuper { public: virtual double acceptCash(double money) { return 0; } }; // 正常收费 class CashNormal:pub...
2014-11-27 13:52:00 400
原创 c++ 简单工厂模式
#include <iostream> #include <string> using namespace std; // 操作类 class Operation { public: // 第一个操作数 get/set 方法 void setNumberA(double numberA) { this-...
2014-11-26 21:14:00 71
原创 lua 多继承
local function search(k, tables) for i, v in ipairs(tables) do --print(111111111,k) if v[k] then return v[k] end end return nil end -- 这里实现多重继承,参数arg为多重...
2014-11-21 16:56:00 175
原创 c++ 随机数
#include <iostream> #include <Random> using namespace std; int main() { std :: default_random_engine e ; for ( size_t i = 0 ; i < 10 ; i ++ ) { cout << e ( ) <&l...
2014-11-14 22:42:00 127
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人