#include<iostream>
using namespace std;
class student{
public:
student(double a,double b)
{
number=a;
score=b;
}
void show()
{
cout<<number<<" "<<score<<endl;
}
private:
double number;
double score;
};
int main()
{
student stu[6]={
student(01,90),
student(02,90),
student(03,70),
student(04,60),
student(05,70),
student(06,80)
};
student *pr;
pr=stu;
pr++;
pr->show();
pr=pr+2;
pr->show();
pr=pr+2;
pr->show();
system("pause");
return 0;
}
4.17
最新推荐文章于 2024-05-27 00:11:36 发布