⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 7_7.cpp

📁 c++书籍的源代码
💻 CPP
字号:
#include<iostream.h>
class A1
{
 public:
   A1(int x);
 protected:
   int a;
};
A1::A1(int x)
{
  a=x;
}
class A2
{
 public:
   A2(int x);
 protected:
   int a;
};
A2::A2(int x)
{
  a=x;
}
class A3:public A1,public A2
{
 public:
   A3(int x,int y,int z);
   void display(void);
 private:
   int a;	 
};
A3::A3(int x,int y,int z):A1(x),A2(y)
{
  a=z;
}
void A3::display(void)
{
 cout<<"A1::a="<<A1::a<<endl;
 cout<<"A2::a="<<A2::a<<endl;
 cout<<"a="<<a<<endl;
}
int main()
{
  A3 s(1,2,3);
  s.display(); 
  return(0);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -