
部分功能代码,按照这个完善一下就可以。
#include "stdio.h"
#define N 2
struct Student
{
//学号
int num; //成员变量或者一个数据项
//姓名
char name[20];
//性别
char sex; //M,F
//成绩
float html;
float ppt;
float cyuyan;
float sum;
}st[N];
void input();
void display();
void main()
{
input();
display();
}
//输入函数
void input()
{
int i;
for(i=0;i<N;i++)
{
printf("请输入第%d个学生的学号,姓名,性别,html,ppt,cyuyan:",i+1);
scanf("%d",&st[i].num);
scanf("%s ",st[i].name);
scanf("%c ",&st[i].sex);
scanf("%f",&st[i].html);
scanf("%f",&st[i].ppt);
scanf("%f",&st[i].cyuyan);
st[i].sum = st[i].html+st[i].ppt+st[i].cyuyan;
}
}