新增加计算平均分,修改了一个bug,暂时无大的改动。 / // 基本功能: // // 可以输入几名学生姓名 学号 语数英三门课程分数 // // 能根据学生姓名,输出其各科成绩,计算三门平均分// / #include <iostream> #include <iomanip> #include <string> using namespace std; int welcome(); //welcome函数用来打印最开始的欢迎词及指导词 class student { private: string name; int num; double mark[3]; double average; static int population; //population用于存放学生个数 public: char judge; //judge用于存放y/n student * next; void input(); //输入学生的信息 void cal_average(); static void output(student *); //输出学生信息 }; int student::population=0; int main() { const int N=1000; student stu[N]; student *p=&stu[0]; if(welcome()==1) //如果用户输入1,则开始输入数据 { for(int i=0;i<N;i