用C语言解答:编程输入3个学生的学号、姓名、三门课程的成绩,存入一个结构体型的数组,统计每

来源:百度知道 编辑:UC知道 时间:2024/05/11 16:28:19
要快啊 我把分全加给他

#include<stdio.h>
#include<stdlib.h>
struct score
{
int num;
char name[12];
int math;
int english;
int computer;
long sum;
double average;
}a;
main()
{
int i , sum ;
struct score *p
for(i=0;i<10;i++)
{
printf("输入各项信息:\n");
printf("学号,姓名,数学,英语,计算机:\n");
scanf("%d%s%d%d%d",&p->num,&p->name,&p->math,&p->english,&p->computer);
sum = p->math+p->english+p->computer;
printf("%d %s %d %d %d %d %f \n",p->num,p->name, p->math,p->english,p->computer,sum, sum/3.0 );
}
system("PAUSE");
}