//冒泡排序
int[] scores = { 12,43,14,54,23,65,87,98};
for (int i = 0; i < scores.Length - 1; i++)
{
for (int j = 0; j < scores.Length - 1 - i; j++)
{
if (scores[j] > scores[j + 1])
{
int temp = 0;
temp = scores[j];
scores[j] = scores[j + 1];
scores[j + 1] = temp;
}
}
}
for (int i = 0; i < scores.Length; i++)
{
Console.WriteLine(scores[i]);
}
Console.ReadKey();