/** 程序的版权和版本声明部分* Copyright (c)2012, 烟台大学计算机学院学生* All rightsreserved.* 文件名称: object.cpp* 作者:纪子龙* 完成日期: 2013年3 月 21 日* 版本号: v1.0* 输入描述:无* 问题描述:无* 程序输出:无
*/#include using namespace std;class Student{private: long num; double score;public: void input(); void output();long max(Student *arr);};long Student::max(Student *arr){ int max=-1;for (int i=0; i<5;i++){ if(arr[i].score > max) max=arr[i].score;} for(i=0;i<5;i++) { if(max==arr[i].score) return arr[i].num; }}void Student::input(){ cout<<"please input student num and score"< >num>>score;}void Student::output(){ cout< <<" "< <