main
p9exg5sqa 5 months ago
parent fc41971171
commit 4f5b477246

33
2.cpp

@ -0,0 +1,33 @@
#include <iostream>
using namespace std;
class A{
public:
A(int i){a=i;b=0;}
A(int i,int j){a=i;b=j;}
void display(){cout<<"a="<<a<<" b="<<b;}
private:
int a,b;
};
class B:A{
public:
B(int i=2024,int j=6,int k=26):A(i+1,j*2),c(k/7){ }
void display1( ){
display( );
cout<<" c="<<23<<endl;
}
private:
int c;
};
int main( ){
int x,y,z;
cin>>x>>y>>z;
B b1;
B b2(x);
B b3(x,y);
b1.display1( );
b2.display1( );
b3.display1( );
return 0;
}
Loading…
Cancel
Save