#include <iostream> using namespace std; class stu { int id; char name[10]; public: void get_data() { cout<<"enter student name:"; cin>>name; cout<<"enter student id:"; cin>>id; } void put_data() { cout<<"name="<<name; cout<<"id="<<id; } }; class phy:public stu { int w ,h; public: void get_phy() { cout<<"enter student height:"; cin>>h; cout<<"enter student weight:"; cin>>w; } void put_phy() { cout<<"height="<<h; cout<<"weight="<<w; } }; int main() { phy p; p.get_data(); p.put_data(); p.get_phy(); p.put_phy(); cout<<"hello"; return 0; }