8059:定义学生类

Time/Memory Limit:1000 MS/32768 K
Submitted: 641 Accepted: 455

 Problem Description

定义学生类student,类的结构如下
class student
{
 public:
   student(int,char *,int,float);//需提示"Constructing..."
   ~student();//需提示"Destructing..."
   void printstu();
 private:
   int id;
   char *name;
   int age;
   float score;
};
将类定义完整,并在主函数中进行测试。

 Input

输入数据有多行。

 Output

对于每个测试数据,输出有多行。

 Sample Input

1 zhangsan 19 80
2 lisi 20 91
3 wangwu 18 85

 Sample Output

Constructing...
Num:1 Name:zhangsan Age:19 Score:80
Destructing...
Constructing...
Num:2 Name:lisi Age:20 Score:91
Destructing...
Constructing...
Num:3 Name:wangwu Age:18 Score:85
Destructing...

 Author

wj

 Recommend

zh