#include
#include
using namespace std;
class student
{
public:
student(int a,string b):num(a),name(b){ }
void display()
{cout<<"num:"< cout<<"name:"<private:
int num;
string name;
};
class student1:public student
{public:
student1(int a,string b,int c):student(a,b){age=c;}
void show()
{ display();
cout<<"age:"<private:
int age;
};
class student2:public student1
{
public:
student2(int a,string b,int c,int d):student1(a,b,c){score=d;}
void show_all()
{
show();
cout<<"score:"< }
private:
int score;
}; //这里少了一个分号
int main()
{
student2 stu(1,"hehe",22,100);
stu.show_all();
return 0;
}