#include "stdio.h"
#define N 5
void print(struct student stu[3]);
struct student
{
int num;
float math,chinese,
english,total,A;
}stu[N];
void main()
{
int i;
for(i=0;i<=3;i++)
{
printf("input num of stu %d:\n",i+1);
printf("NO.:");
scanf("%d",stu[i].num);
printf("math:");
scanf("%2f",stu[i].math);
printf("chinese:");
scanf("%2f",stu[i].chinese);
printf("english:");
scanf("%2f",stu[i].english);
stu[i].total=stu[i].math+stu[i].chinese+stu[i].english;
stu[i].A=stu[i].total/3.0;
printf("\n");
}print(stu);
}
void print(struct student stu[3])
{
int i;
printf("\n NO. math,chinese english total A\n");
for(i=0;i<3;i++)
{
printf("%d%2f%2f%2f%2f%2f",stu[i].num,stu[i].math,stu[i].chinese,
stu[i].english,stu[i].total,stu[i].A);
}printf("\n");
}
我用WIN-TC1.91运行之后怎么都出现未定义 student 啊
请知道的告诉我一下 要怎么改 谢谢!