|
|
@ -257,7 +257,24 @@ void SearchbyNum(STU stu[],int n,int m)
|
|
|
|
```
|
|
|
|
```
|
|
|
|
void SearchbyName(STU stu[],int n,int m)
|
|
|
|
void SearchbyName(STU stu[],int n,int m)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
char x[MAX_LEN];
|
|
|
|
|
|
|
|
int i,j;
|
|
|
|
|
|
|
|
printf("Input the name you want to search:");
|
|
|
|
|
|
|
|
scanf("%s", x);
|
|
|
|
|
|
|
|
for(i=0;i<n;i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(strcmp(stu[i].name,x)==0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
printf("%ld\t%s\t",stu[i].num,stu[i].name);
|
|
|
|
|
|
|
|
for(j=0;j<m;j++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
printf("%.0f\t",stu[i].score[j]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
printf(".0f\t%.0f\n",stu[i].sum,stu[i].aver);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
printf("\nNot found!\n);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|