作者:淘老婆桃桃_267 | 来源:互联网 | 2023-10-11 15:01
usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;namespace冒泡排
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace 冒泡排序
{
class Program
{
static void Main(string[] args)
{
int[] sores = { 18, 19, 20, 45, 62, 32, 89, 75, 41, 32, 69 };
for (int i = 0; i for (int j = 0; j {
int team;
if (sores[j] {
team = sores[j];
sores[j] = sores[j +1];
sores[j +1] = team;
}
}
Console.WriteLine("按顺序从小到大排列后的数组是");
for(int i=0;i Console.Write(sores[i]+" ");
Console.ReadKey();
}
}
}
使用C#完成冒泡排序