|
|
|
@ -572,7 +572,7 @@ int main(void)
|
|
|
|
|
int n = 0,m = 0;
|
|
|
|
|
STU stu[STU_NUM];
|
|
|
|
|
printf("Input student number(n<%d):",STU_NUM);
|
|
|
|
|
scnaf("%d",&n);
|
|
|
|
|
scanf("%d",&n);
|
|
|
|
|
printf("Input course number(m<=%d):",COURSE_NUM);
|
|
|
|
|
scanf("%d",&m);
|
|
|
|
|
while(1)
|
|
|
|
@ -615,7 +615,7 @@ int main(void)
|
|
|
|
|
case 13:ReadfromFile(stu,&n,&m);
|
|
|
|
|
break;
|
|
|
|
|
case 0: printf("Are you sure you want to exit?(Y/N):");
|
|
|
|
|
printf("End of program!);
|
|
|
|
|
printf("End of program!");
|
|
|
|
|
exit(0);
|
|
|
|
|
default:printf("Input error!");
|
|
|
|
|
}
|
|
|
|
@ -656,7 +656,7 @@ void ReadScore(STU stu[],int n,int m)
|
|
|
|
|
{
|
|
|
|
|
int i,j;
|
|
|
|
|
printf("Input student's ID ,name and score:\n");
|
|
|
|
|
for(i=0,i<n;i++) //输入n个同学
|
|
|
|
|
for(i=0;i<n;i++) //输入n个同学
|
|
|
|
|
{
|
|
|
|
|
scanf("%ld%s",&stu[i].num,stu[i].name);
|
|
|
|
|
for(j=0;j<m;j++) //输入m门成绩
|
|
|
|
@ -705,7 +705,7 @@ void AverSumofEveryCourse(STU stu[],int n,int m)
|
|
|
|
|
|
|
|
|
|
//函数功能:按选择法将数组 sum 的元素值排序
|
|
|
|
|
```
|
|
|
|
|
voidSortbyScore(STU stu[],int n,int m,int(*compare)(float a,float b))
|
|
|
|
|
void SortbyScore(STU stu[],int n,int m,int(*compare)(float a,float b))
|
|
|
|
|
{
|
|
|
|
|
int i, j, k, t;
|
|
|
|
|
for (i=0; i<n-1; i++)
|
|
|
|
@ -770,7 +770,7 @@ void SwapLong(long *x,long *y)
|
|
|
|
|
|
|
|
|
|
//交换两个字符串
|
|
|
|
|
```
|
|
|
|
|
void SwapChar(char x[],chary[])
|
|
|
|
|
void SwapChar(char x[],char y[])
|
|
|
|
|
{
|
|
|
|
|
char temp[MAX_LEN];
|
|
|
|
|
strcpy(temp, x);
|
|
|
|
@ -875,7 +875,7 @@ void SearchbyName(STU stu[],int n,int m)
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
printf("\nNot found!\n);
|
|
|
|
|
printf("\nNot found!\n");
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
@ -975,6 +975,4 @@ void ReadfromFile(STU stu[],int *n,int *m)
|
|
|
|
|
}
|
|
|
|
|
fclose(fp);
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
[def]: AsScortNum.svg
|
|
|
|
|
```
|