6．设计一个学生类（Student），它具有的私有数据成员是：学号、姓名、数学、外语、计算机课程的成绩。
   具有的公有成员函数是：求三门课总成绩的函数sum；求三门课平均成绩的函数average；显示学生数据信息的函数display；
   设置学生数据信息的函数setData。然后通过主函数，从键盘对学生对象的数组（全班学生信息）进行输入，
   而后求出每一学生的总成绩、平均成绩，并显示全班学生总成绩最高者那一同学的全部数据信息。
	#include<iostream>
	#include<math.h>
	#define MAX_LENGTH 31
	using namespace std;
	
	class CStudent{
	public:
	 CStudent(int id,char *name,float math,float english,float computer);
	 float sum()const;
	 float average()const;
	 void display()const;
	private:
	 int CSId;
	 char CSName[MAX_LENGTH];
	 float CSMath;
	 float CSEnglish;
	 float CSComputer;
	 float CSSum;
	 float CSAverage;
	public:
	 CStudent *next; 
	};
	CStudent::CStudent(int id,char *name,float math,float english,float computer){
	 this->CSId = id;
	 strcpy(CSName,name);
	 this->CSMath = math;
	 this->CSEnglish = english;
	 this->CSComputer = computer;
	 this->next = NULL;
	 this->CSSum = this->CSMath + this->CSEnglish + this->CSComputer;
	 this->CSAverage = this->CSSum/3;
	}
	
	float CStudent::sum()const{
	 return this->CSSum;
	}
	
	float CStudent::average()const{
	 return this->CSAverage;
	}
	
	void CStudent::display()const{
	 cout<<"STUDENT ID: "<<this->CSId<<endl;
	 cout<<"NAME: "<<this->CSName<<endl;
	 cout<<"MATH: "<<this->CSMath<<endl;
	 cout<<"ENGLISH: "<<this->CSEnglish<<endl;
	 cout<<"COMPUTER: "<<this->CSComputer<<endl;
	 cout<<"SUM: "<<this->sum()<<endl;
	 cout<<"AVERAGE: "<<this->average()<<endl;
	 cout<<"------------------------------------------------------------------"<<endl;
	    
	}
	void setData(CStudent* &head,int &CSCount){
	CStudent *p = NULL;
	int id = 0;
	char name[MAX_LENGTH];
	float math;
	float english;
	float computer;
	
	while(true){
	   cout<<"Input Info Of Students,End If Student Id Inputed equal to -1!"<<endl;
	   
	   cin>>id;
	   if(id == -1)
	   break;
	   cin>>name;
	   cin>>math;
	   cin>>english;
	   cin>>computer;
	 
	 if(CSCount == 0){
	     head = new CStudent(id,name,math,english,computer);
	     p = head;
	     CSCount++;
	 }
	 else{
	  p->next = new CStudent(id,name,math,english,computer);
	  p = p->next;
	     CSCount++;
	  }
	 }
	}
	
	float getMaxSum(CStudent *head){
	 CStudent *p = head;
	 float MaxSum = -1;
	 while(p != NULL){
	  if(p->average() > MaxSum)
	   MaxSum = p->sum();
	
	  p = p->next;
	 }
	 return MaxSum;
	}
	
	void displayMaxSumStudents(CStudent *head,float MaxSum){
	 CStudent *p = head;
	
	 while(p != NULL){
	  if(p->sum() == MaxSum)
	   p->display();
	
	  p = p->next;
	 }
	}
	int  main(){
	CStudent *head = NULL;
	int CSCount = 0;
	
	setData(head,CSCount);
	cout<<"班里总分最高的所有学生信息如下："<<endl;
	cout<<"------------------------------------------------------------------"<<endl;
	displayMaxSumStudents(head,getMaxSum(head));
	return 0;
	}