#include < iostream >
using namespace std ;
class basw
{
private : int x ;
pucllic : base ( int a ) { x = a ; }
int get ( ) { return x ; }
void showbase( ) {cout << "x=" << x << endl ; }
};
class Derived : public base
{ private : int y ;
public : Derived ( int a , int b ) ; base ( a ) { y = b ; }
void showderived ( )
{ cout << "x=" << get ( ) << " , y= " << y << endl ; }
};
void main ( )
{
base b ( 3 ) ;
Derivd d (6 , 7) ;
b . showbase ( ) ;
d . showderived ( ) ;
_____________________________ ;
b. showbase ( ) ;
_____________________________ ;
b1 . showbase ( ) ;
}输出结果如下: x=3 x=6,y=7 x=6 x=6 x=6 x=6,y=7 x=6
(1)b=d (2)base b1(6)