init commit

This commit is contained in:
2024-03-19 01:05:51 +08:00
commit 199bbf2628
393 changed files with 34883 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
#include <iostream>
using namespace std;
class method
{
public:
void Method()
{
cout << "方法Method调用成功" << endl;
}
};
class methodProxy
{
protected:
method *m;
public:
methodProxy()
{
m = new method();
}
void Method(int uid)
{
cout << "用户" << uid << "方法Method()被调用" << time(NULL) << endl;
if (uid > 10)
{
cout << "用户" << uid << "方法Method()调用失败" << time(NULL) << endl;
return;
}
this->m->Method();
cout << "用户" << uid << "方法Method()调用结束" << time(NULL) << endl;
}
};
int main()
{
methodProxy *proxy = new methodProxy();
proxy->Method(1);
proxy->Method(11);
return 0;
}