int main()
{
cout<<"当前系统中有"<<Student::getCount()<<"位学生\n";
Student stu1("张三", 1985, 1, 1);
stu1.addCourse("高级语言程序设计-2", 3);
stu1.addCourse(new Course("数学分析", 5));
stu1.addCourse("体育", 2);
Date d(1987, 3, 1);
Student stu2("李四", d);
stu2.addCourse("高级语言程序设计-2", 3);
stu2.addCourse(new Course("数学分析", 5));
stu2.addCourse("思想道德修养", 2);
Student *stu3;
stu3=new Student("王五", 1986, 2, 28);
stu3->addCourse("高级语言程序设计-2", 3);
stu3->addCourse(new Course("数学分析", 5));
stu3->addCourse("音乐欣赏", 2);
cout<<"=======================================\n";
cout<<"当前系统中有"<<Student::getCount()<<"位学生\n";
cout<<stu1<<stu2<<(*stu3);
delete stu3;
cout<<"=======================================\n";
cout<<"当前系统中有"<<Student::getCount()<<"位学生\n";
cout<<stu1<<stu2<<endl;
return 0;
回复 更多评论