From 163aa32d0b4381865207696f786990ff4c10394c Mon Sep 17 00:00:00 2001 From: e2hang <2099307493@qq.com> Date: Sat, 4 Oct 2025 18:57:54 +0800 Subject: [PATCH] New OOP --- .../P1025 [NOIP 2001 提高组] 数的划分.cpp | 0 Object-Oriented-Programming/嵌套类.cpp | 38 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 Algorithm/DP-DynamicProgramming/P1025 [NOIP 2001 提高组] 数的划分.cpp create mode 100644 Object-Oriented-Programming/嵌套类.cpp diff --git a/Algorithm/DP-DynamicProgramming/P1025 [NOIP 2001 提高组] 数的划分.cpp b/Algorithm/DP-DynamicProgramming/P1025 [NOIP 2001 提高组] 数的划分.cpp new file mode 100644 index 0000000..e69de29 diff --git a/Object-Oriented-Programming/嵌套类.cpp b/Object-Oriented-Programming/嵌套类.cpp new file mode 100644 index 0000000..a4b5158 --- /dev/null +++ b/Object-Oriented-Programming/嵌套类.cpp @@ -0,0 +1,38 @@ +#include +using namespace std; +class Engine{ +public: + int layer1; + class WaterTank{ + public: + int layer3; + class Water{ + public: + int layer5; + }; + }; + private: + int layer8; + class Tank{ + public: + int layer9; + }; + }; +private: + int layer2; + class EngineRope{ + public: + int layer6; + class Rope{ + public: + int layer7; + }; + }; + +}; + +int main(){ + Engine A; + cout << A.layer1 << A.WaterTank.layer3 << A.WaterTank.Water.layer5 + return 0; +}