#include<stdio.h>
#include<string.h>
struct student
{
int num;
char name[50];
double scare;
};
void add (struct student stus[])
{
char name[5];
printf("请输入要查找的学员的姓名: \n");
fflush(stdin);
gets(name);
for(int j=0;;j++)
{
if(strcmp(name,stus[j].name)==0)
{
printf("%s:%lf\n",stus[j].name,stus[j].scare);
break;
}
}
}
void main()
{
struct student stus[5]={{1,'lj',60},{2,'ly'70},{3,'hw',80},{4,'yh'90},{5,'lf',95}};
printf("学员信息\n");
printf("==================================================\n");
for(int i=0;i<5;i++)
{
printf("%d\n",stus[i].num);
printf("%d\n",stus[i].name);
printf("%d\n",stus[i].scare);
}
add(stus);
}
错在那里啊