#include<iostream>
#include<string>
using namespace std;
class student
{
public:
student (string a,double b)
{
num=a;
score=b;
}
void show();
private:
string num;
double score;
};
void student:: show()
{
cout<<num<<" "<<score<<endl;
}
int main()
{
student *pr;
student stu[6]={student("wubeiren",89),student("yanwenfa",100),student("lianjinxin",94),student("lvyingchuang",100),
student("zhangya",96),student("liyifan",98)};
pr=stu;
pr=pr+1;
pr->show();
pr=pr+2;
pr->show();
pr=pr+2;
pr->show();
return 0;
}
4.17
最新推荐文章于 2024-05-28 15:13:21 发布