using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace 求最大值
{
class Program
{
static void Main(string[] args)
{
int[] s = new int[11] { 33,10,-1,22,132,56,16,1645,13,0,169};
int temp;
for (int i = 0; i < s.Length - 1; i++)
{
for (int j = i + 1; j < s.Length; j++)
{
if (s[j] < s[i])
{
temp = s[j];
s[j]= s[i];
s[i] = temp;
}
}
}
for (int i = 0; i < s.Length; i++)
{
Console.Write(s[i] + " ");
}
Console.ReadKey();
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace 求最大值
{
class Program
{
static void Main(string[] args)
{
int[] s = new int[11] { 33,10,-1,22,132,56,16,1645,13,0,169};
int temp;
for (int i = 0; i < s.Length - 1; i++)
{
for (int j = i + 1; j < s.Length; j++)
{
if (s[j] < s[i])
{
temp = s[j];
s[j]= s[i];
s[i] = temp;
}
}
}
for (int i = 0; i < s.Length; i++)
{
Console.Write(s[i] + " ");
}
Console.ReadKey();
}
}
}