河南成教 / 面向对象程序设计
21[分析题]
class Student { int studentNo; static int count; public: Student() { count ;StudentNo=count;} void print(){ cout<<StudentNo<<endl; }};int Student::count=0;main(){ Student student1; student1.print(); Student student2;student2.print();student *p;p= new Student;p->print();}
21[分析题]
class Student { int studentNo; static int count; public: Student() { count ;StudentNo=count;} void print(){ cout<<StudentNo<<endl; }};int Student::count=0;main(){ Student student1; student1.print(); Student student2;student2.print();student *p;p= new Student;p->print();}
参考答案:
佳题速递: