用c++编程!学生考试成绩分析系统
printf (" 英语 = %d \n ", stu[index].score[0] );
printf (" 数学 = %d \n ", stu[index].score[1] );
printf (" 计算机= %d \n ", stu[index].score[2] );
printf (" 总分 = %4.1f \n ", stu[index].avg );
printf (" 平均分= %d \n ", stu[index].sum );
}
else
printf (" 没有找到改学号的学生数据! \n " );
getchar();
printf ( "是否继续查找?(y/n)\n" );
scanf ("%c",&searchnext );
if ( searchnext == 'n' || searchnext == 'N' )
break;
else
continue;
}
while ( 1 );
}
int SearchByID(char *p) /* -1:未找到; 0..nCurrent-1: 找到.其值为数组下标 */
{
int left = 0;
int right = nCurrent - 1;
int mid;
int find = -1;
int result;
do
{
mid = ( left + right ) / 2;
result = strcmp ( p, stu[mid].id );
if ( result == 0 )
find = mid;
else if ( result < 0 )
right = mid - 1;
else if ( result > 0 )
left = mid + 1;
}
while ( ( left <= right ) && ( find == -1 ) );
return find;
}
void SortData(void)
{
PrepareData();
BubbleSort(6);
}
void BubbleSort(int which) /* which是排序字段,1:学号 2:姓名 3:英语 4:数学 5:计算机 6:总分 */
{
struct Student temp;
int result;
for ( int i=0; i<nCurrent-1; i++ )
for ( int j=i+1; j<nCurrent; j++ )
参与评论- 相关内容
- 最近更新
- ·数据结构实验问题
- ·怎么才能学好编程
- ·求素數為什么會出現負數
- ·已知小写字母m的十进制的ASCll码..
- ·c语言交流
- ·C语言练习题
- ·一道C语言编程题...我觉得好难哦..
- ·ox005c0268指令引用ox00000064内..
- ·为什么会输出这样的结果?
- ·求解一道运用C语言的问题
添加到百度搜藏