建立一个对象数组,内放5个学生的数据(学号、成绩),设立一个函数max,用指向对象的指针做函数参数,在max函数中找出5个学生中成绩最高者,并输出其学号及最高成绩。
摘要:
#include <iostream>using namespace std;class Student{public: void max(int *p,float *t);};void Student::max(int *p,float *t){ int i; int a=0, b; for (i 阅读全文
posted @ 2023-03-21 22:04 悟空+ 阅读(523) 评论(0) 推荐(0)