结构体
#include <stdio.h>#define N 4
struct student
{
int no[6];
char name[8];
int age[4];
int score[4];
int standing[5];
int weight[5];
}stu[N];
main()
{
int i;
input(stu);
for(i=1;i<=N;i++)
{
printf("%6d%8s%4d%4d%5d%5d",stu[i].no,stu[i].name,stu[i].age,stu[i].score,stu[i].standing,stu[i].weight);
printf("\n"); 请问这个输出有什么问题,最后编译后输出的数据错
}
getch();
}
input(struct student stu[N])
{
int i;
for(i=1;i<=N;i++)
{
printf("please input data ofstudent %d\n",i);
printf("clease no:");
scanf("%d",stu[i].no);
printf("name:");
scanf("%s",stu[i].name);
printf("age:");
scanf("%d",stu[i].age);
printf("score:");
scanf("%d",stu[i].score);
printf("standing:");
scanf("%d",stu[i].standing);
printf("weight:");
scanf("%d",stu[i].weight);
}
printf("\n");
}