📄 t4.cpp
字号:
#include<iostream.h>
class A
{
int a;
public:
void seta(int x) { a=x; }
void showa() { cout<<a<<endl; }
};
class B
{
int b;
public:
void setb(int x) { b=x; }
void showb() { cout<<b<<endl; }
};
class C :public A ,private B
{
int c;
public:
void setc(int x,int y, int z)
{
c=z;
seta(x);
setb(y);
}
void showc() { cout<<c<<endl;}
};
void main()
{
C t;
t.seta(1);
t.showa();
t.setc(1,2,3);
t.showc();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -