1916: Person_Student_Teacher
内存限制:128 MB
时间限制:1.000 S
评测方式:文本比较
命题人:
提交:77
解决:49
题目描述
define a Person class,which contains two data fields: id and name;
define a Student class and Teacher class by extending Person class ,respectively,Student has a new data field: grade,Teacher has a new data field: department
输入
there are many cases, for each case,input a character 'S' denoting a Student or 'T' denoting a Teacher,
输出
output the information of the Student or the Teacher as required
样例输入 复制
S 101 WangLi 90
T 201 LiXin CS
S 102 ChenHuan 99
样例输出 复制
id:101 name:WangLi grade:90
id:201 name:LiXin department:CS
id:102 name:ChenHuan grade:99