帮忙做一道c语言的题目。

来源:百度知道 编辑:UC知道 时间:2024/09/22 03:10:25
某班期终考试科目为高数 (MT) 、英语 (EN) 和物理 (PH) ,有 30 人参加考试。为评定奖学金,要求统计并输出一个表格,表格内容包括学号、各科分数、总分和平均分,并标出三门课均在 90 分以上者(该栏标志输出为〃 Y 〃,否则为〃 N 〃),表格形式如下:

NO MT EN PH SUM V >90

1 97 87 92 276 92 N

2 92 91 90 273 91 Y

3 90 81 82 253 84 N

…… …… …… ……
我做的是下边的,不知道怎么错了。

# include<stdio.h>
#define STU struct student
STU
{
int NO;
int MT;
int EN;
int PH;
int SUM;
int V;
char YN;
};
main ()
{
int i;
STU st[8];
printf ("\n Enter data:");
for (i=0;i<8;i++)
{
scanf("%d%d%d%d%d",&st[i].NO,&st[i].MT,&st[i].EN,&st[i].PH);

&st[i].NO,你这里知道要加&,怎么后面几个都不加了

# include<stdio.h>
#define STU struct student
STU
{
int NO;
int MT;
int EN;
int PH;
int SUM;
int V;
char YN;
};
main ()
{
int i;
STU st[8];
printf ("\n Enter data:");
for (i=0;i<8;i++)
{
scanf("%d%d%d%d%d",&st[i].NO,&st[i].MT,&st[i].EN,&st[i].PH);
st[i].SUM=st[i].MT+st[i].EN+st[i].PH;
st[i].V=st[i].SUM/3;
}
for (i=0;i<8;i++)
if (st[i].MT>90&&st[i].EN>90&&st[i].PH>90)
{st[i].YN='Y';
printf("\n%d%d%d%d%d%d%s",st[i].NO,st[i].MT,st[i].EN,st[i].PH,st[i].YN);}
else
{st[i].YN='N';
printf("\n%d%d%d%d%d%d%s",st[i].NO,st[i].MT,st[i].EN,st[i].PH,st[i].YN);} getch();
}

# include<stdio.h>
#define STU st