急求。。。C++实验编程序

来源:百度知道 编辑:UC知道 时间:2024/06/20 23:44:12
编写一个学生和教师数据输入和显示程序,学生数据有编号、姓名、班级和成绩,教师数据有编号、姓名、职称和部门。要求将编号、姓名输入和显示设计成一个类person,并作为学生数据操作类student和教师类数据操作类teacher的基类。

#include<iostream.h>
struct student{numbel ;
name;
class;
score;}A;
A{小强;三年级二班;90};cout<<A;

struct teacher{numbel;
name;
title;
department;}B;
B{10;俞林;教授;教务处};
cout<<B;