#include<stdio.h>
#include<stdlib.h>
#define MAX 50;
int main()
{
int i,n;
int Chinese [MAX];
int Math [MAX];
int English [MAX];
long studentID [MAX];
double Ave [MAX];
printf("please input the number of the students\n\n");
scanf("%d"&i);
printf("please input a student ID and three scores\n");
printf(" Studeng ID Cinese Math English\n");
for(n=0;n<=i;i++)
{
printf("NO.%d>",i);
scanf("%ld%d%d%d",&studentID[i],&Chinese[i],Math[i],English[i]);
Ave[i]=(Chinese[i]+Math[i]+English[i])/3;
}
printf("\n");
printf("\n");
printf("StudentNum Chinese Math English Ave\n");
for(n=0;n<=i;i++)
{
printf("%ld\t%d\t%d\t%d\t%lf\n",StudentID[i],Chinese[i],Math[i],English[i],Ave[MAX]);
}
return 0;
}
#include<stdlib.h>
#define MAX 50;
int main()
{
int i,n;
int Chinese [MAX];
int Math [MAX];
int English [MAX];
long studentID [MAX];
double Ave [MAX];
printf("please input the number of the students\n\n");
scanf("%d"&i);
printf("please input a student ID and three scores\n");
printf(" Studeng ID Cinese Math English\n");
for(n=0;n<=i;i++)
{
printf("NO.%d>",i);
scanf("%ld%d%d%d",&studentID[i],&Chinese[i],Math[i],English[i]);
Ave[i]=(Chinese[i]+Math[i]+English[i])/3;
}
printf("\n");
printf("\n");
printf("StudentNum Chinese Math English Ave\n");
for(n=0;n<=i;i++)
{
printf("%ld\t%d\t%d\t%d\t%lf\n",StudentID[i],Chinese[i],Math[i],English[i],Ave[MAX]);
}
return 0;
}