11.3 ñԱ
#include <iostream>
#include <string>
using namespace std;
class Student//
{public:                             //๫óԱ
  void display( );
 protected :                         //ౣԱ
int num;
string name;
char sex;
};

void Student::display( )             //Ա
   {cout<<num: <<num<<endl;
    cout<<name: <<name<<endl;
    cout<<sex: <<sex<<endl;
   }

class Student1: protected Student        //protectedʽStudent1
{public:
void display1( );                      //๫óԱ
private:
int age;                                //˽ݳԱ
string addr;                          //˽ݳԱ
};

void Student1::display1( )                 //๫óԱ
    {cout<<num: <<num<<endl;            //ûıԱϷ
     cout<<name: <<name<<endl;          //ûıԱϷ
   cout<<sex: <<sex<<endl;            //ûıԱϷ
     cout<<age: <<age<<endl;            //˽гԱϷ
     cout<<address: <<addr<<endl;       //˽гԱϷ
   }

int main( )
 {Student1 stud1;                     //stud1Student1Ķ
  stud1.display1( );                  //Ϸdisplay1еĹóԱ
  stud1.num=10023;                    //粻ܷʱԱ
return 0;
 }