大佬帮忙纠正一下
#include<stdio.h>struct Data{
int year;
int month;
int day;
char name[20];
int age;
};
struct Data sd[5]={{2021,9,1,"zhangshan",18},{2021,9,1,"lisi",19},{2020,9,20,"wanghu",20},
{2020,9,23,"liubin",20},{2019,9,30,"hudayong",21}};
int main()
{
void input(struct Data sd[5]);
struct Data*p;
printf("年. 月 .日 .姓名 年龄. 平均年龄\n");
for(p=sd;p<sd+5;p++)
printf("%4d %d %d %-20s %2d %d\n",p->year,p->month,p->day,p->nam,p->age,p->arrage);
return 0;
}
void input(struct Data sd[5])
{
sd[5].arrage=(sd[5].a[0]+sd[5].a[1]+sd[5].a[2]+sd[5].a[3]+sd[5].a[4])/3;
}