|
|
|
@ -249,9 +249,7 @@ void SortbyName(STU stu[],int n,int m)
|
|
|
|
|
```
|
|
|
|
|
void SearchbyNum(STU stu[],int n,int m)
|
|
|
|
|
{
|
|
|
|
|
long number;
|
|
|
|
|
int i,j;
|
|
|
|
|
printf("Input the number you want to search:");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
@ -259,7 +257,24 @@ void SearchbyNum(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);
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|