#include <iostream>
#include <string>
using namespace std;
class Student
{
private:
int num;
string name;
float score;
public:
Student(int num,string name,floatscore):
num(num),name(name),score(score){}
void show()
{cout<<num<<" "<<name<<" "<<score<<endl;}
};
int main()
{
Student s[5]={
Student(1001,"Huahua",98.8),
Student(1002,"Laoxiao",69.8),
Student(1003,"Shenshen",58.9),
Student(1004,"Lala",84.3),
Student(1005,"Mixiya",72.8),};
Student *p=s; //Student *p=&s[0];
for(int i=0;i<=2;p=p+2,i++)
{p->show();}
return 0;
}
因篇幅问题不能全部显示,请点此查看更多更全内容
Copyright © 2019- awee.cn 版权所有 湘ICP备2023022495号-5
违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务