#include<iostream>
using namespace std;
class Student
{public:
Student(int=10,int=0);
int number;
int score;
void display();
};
Student::Student(int num,int sco):number(num),score(sco){
}
void Student::display()
{
cout<<number<<" "<<score<<endl;
}
void max(Student *p)
{
int maxi=p[0].score;
int temp=0;
for(int i=1;i<5;i++)
if(p[i].score>maxi)
{
maxi=p[i].score;
temp=i;
}
cout<<p[temp].number<<" "<<maxi<<endl;
}
int main()
{
Student stu[5]={
Student{1001,90},
Student{1002,80},
Student{1003,99},
Student{1004,84},
Student{1005,85}
};
Student *p=&stu[0];
max(p);
return 0;
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有