基本信息
文件名称:国开电大《数据结构》实验排序.docx
文件大小:146.78 KB
总页数:4 页
更新时间:2025-09-08
总字数:约1.77千字
文档摘要
冒泡法排序的改进
?设计程序代码如下:
#includestdio.h
#includestring.h
#defineMAX3
structstudent{
charname[10];
floatcs;
floatms;
floates;
floatavg;
};
voidsort(structstudents[],intn);
voidsort(structstudents[],intn)
{
structstudenttemp;
inti,j;
for(i=1;in;i++)
for(j=0;jn-i;j++)
if(s[j].avgs