protected:
int x;
};
class D: public C {
public:
void test_scope() const {
cout << "x = " << x << endl; // 用父类的x,输出: x = 0
print(); // 调用父类的print(),输出: C::print()
}
int main() {
A<int> a;
a.test_scope();
D d;
d.test_scope();