新建一个控制台程序, 规则:相邻两个数进行比较,重复循环判断
static List<int> list = new List<int>() { 72, 83, 54, 59, 30, 31, 78, 2, 77, 82, 84, 85, 86, 89, 90 };
static void Main(string[] args)
{
int temp = 0;
for (int i = 0; i < list.Count; i++)
{
for (int j = 1; j < list.Count; j++)
{
if (list[j] > list[i])
{
temp = list[j];
list[i] = list[j];
list[j] = temp;
}
}
}
Console.Write(temp);
Console.ReadLine();
}