#include <iostream>
using namespace std;
class Student
{
protected:
int num;
string name;
};
class Student1:public Student
{
public:
void get2()
{
cin>>num>>name>>sex>>score;
}
void display2()
{
cout<<"num:"<<num<<endl;
cout<<"name:"<<name<<endl;
cout<<"sex:"<<sex<<endl;
cout<<"score:"<<score<<endl;
}
private:
string sex;
double score;
};
int main()
{
Student1 stud;
stud.get2();
stud.display2();
return 0;
}
using namespace std;
class Student
{
protected:
int num;
string name;
};
class Student1:public Student
{
public:
void get2()
{
cin>>num>>name>>sex>>score;
}
void display2()
{
cout<<"num:"<<num<<endl;
cout<<"name:"<<name<<endl;
cout<<"sex:"<<sex<<endl;
cout<<"score:"<<score<<endl;
}
private:
string sex;
double score;
};
int main()
{
Student1 stud;
stud.get2();
stud.display2();
return 0;
}