12 2021 档案

摘要:class linkNode: def __init__(self, val, pnext): self.val = val; self.pnext = pnext def removeLastK(head, n): if head == None: return head cur = head w 阅读全文
posted @ 2021-12-06 16:39 海228
摘要:装饰器模式 #include <iostream> using namespace std; //抽象组件类 class Component{ public: virtual void move()=0; }; class ConreteComponentOne: public Component{ 阅读全文
posted @ 2021-12-03 20:38 海228
摘要:#include <iostream> using namespace std; class Target{ //target接口 public: virtual void eat() = 0; virtual void sleep() = 0; }; class Adaptee{ public: 阅读全文
posted @ 2021-12-03 16:58 海228