帮忙用C语言编一个程序 急呀!!!!
来源:百度知道 编辑:UC知道 时间:2024/05/06 14:12:27
有N个学生 每人考N门课程 要求:
找出成绩最高的学生号和课程号;
找出有不及格课程的学生号及其各门课程的全部成绩;
求全部学生全部课程的总平均分。
大家帮帮忙 谢谢
呵呵 忘了 是自己输入, M N 可以自己定义是多少 谢谢
找出成绩最高的学生号和课程号;
找出有不及格课程的学生号及其各门课程的全部成绩;
求全部学生全部课程的总平均分。
大家帮帮忙 谢谢
呵呵 忘了 是自己输入, M N 可以自己定义是多少 谢谢
#include "stdafx.h"
#include "stdio.h"
#include "string.h"
#define M 50
#define N 10
struct complexion
{
char courses[10]; //课程名
int success;
};
typedef struct student
{
int Number;
struct complexion complexion[N];
}Student;
void Getmax(Student *people)
{
char a[10];
int i,j,max,number;
for(i=0;i<N;i++)
{
for(j=0;j<M;j++)
if(max<people[j].complexion[i].success)
{
max=people[j].complexion[i].success;
strcpy(a,people[j].complexion[i].courses);
number=people[j].Number;
}
printf("学号为:%d的%s的成绩最高为:%d\n",number,a,max);
}
}
void Gethang(Student *people)
<