#include<iostream>
using namespace std;
class Student{
public:
Student(float number1,float score1);
void show();
private:
float number;
float score;
};
Student::Student(float number1,float score1)
{ number=number1;
score=score1;
}
void Student::show()
{ cout<<"学号:"<<number<<endl;
cout<<"成绩:"<<score<<endl;
}
int main()
{ Student stu[6]={
Student(11,80),
Student(22,85),
Student(33,88),
Student(44,90),
Student(55,95),
Student(66,100)
};
Student *p;
p=stu;
p=p+1;
p->show();
p=p+2;
p->show();
p=p+2;
p->show();
system("pause");
return 0;
}