#include
#define N 100
struct student
{char num[6];
char name[8];
int score[4];
};
main()
{
int n;
struct student stu[N];
printf("input the number of the students:");
scanf("%d",&n);
input(stu,n);
print(stu,n);
}
viod input( int i,j; )
{
for(i=0;i<n;i++)
{
pintf("学号:");
scanf("%s",stu[i].num);
pintf("姓名:");
scanf("%s",stu[i].name);
for(j=0;j<4;j++)
{
pintf("成绩:",j+1 );
scanf("%d",stu[i].score[j]);
}
}
void output( int i,j )
{
printf("学号\t姓名\t");
for(j=0;j<4;j++)
{
printf("成绩\t",j+1);
}
for(i=0;i<n;i++)
{
printf("%s\t%s\t",stu[i].num,stu[i].name);
for(j=0;j<4;j++)
{
printf("%d\t",stu[i].score[j]);
}
}
这段code问题太多,看不懂你想表述什么,你还是把出错的地方一一列出来吧,这样让别人给你重新程序不好
viod input( int i,j; );
void output( int i,j );
函数使用之前先声明 使用之前加上这两句
错误真的好多 你看着错误信息 自己改改