#include<iostream>
using namespace std;
class Student{
public:
Student(int n,double s):num(n),score(s){}
friend void max(Student&);
private:int num;double score;
};
int main(){
Student stu[5]={Student(101,78.5),Student(111,88.5),
Student(131,68.5),Student(151,58.5),Student(121,98.5)};
void max(Student &*);
Student *p=&stu[0];
max(p);
return 0;
}
void max(Student &*b)
{
double max_s=b[0].score;
int k=0,i;
for(i=0;i<5;i++)
if(b[i].score>max_s) {k=i;max_s=b[i].score;}
cout<<b[k].num <<" "<<max_s<<endl;
}
1.