10名学生5门课

来源:百度知道 编辑:UC知道 时间:2024/06/10 19:01:03
输入10名学生5门功课的成绩 用函数
1)每门课的平均分。
2)找出最高的分数所对应的学生和课程。

实在没时间把找高分的函数完善,不要再发消息了,兄弟,交朋友的话加我qq178484681
#include <iostream>
#include <string>
#include <iomanip>
#define N 3
using namespace std;

struct stu
{string name;
float score[5];

}student[N];
float ave[5];

//****************************************************************************

void getin() //录入函数
{
float sum=0;
int i=0,j;
while (i<N)
{cout<<"###################################"<<endl;

cout<< "输入学生的姓名:";
cin>>student[i].name;

cout<<"输入学生的五科成绩:";
for(j=0;j<5;j++)
cin>>student[i].score[j];
i++;
}
}

//*****************************************************************************

void display()//输出依次用户输入的成绩表
{void f();
void serch();
int i=0,j;
f();
cout<<"****************