You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
517 B

#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;
}