冒泡排序算法
List<Student> stus=new List<Student>();
double temp;
for (int i = 0; i < stus.Count - 1; i++)
{
for (int j = i + 1; j < stus.Count; j++)
{
if (stus[i].Score > stus[j].Score)
{
temp = stus[i].Score;
stus[i].Score = stus[j].Score;
stus[j].Score = temp;
}
}
}

浙公网安备 33010602011771号