using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace 浮点型数组排列
{
class Program
{
static void Main(string[] args)
{
float[] elements = new float[6];
int index;
float temp;
Console.WriteLine("请输入需要进行排序的6个浮点数值");
for(index=0;index < elements.Length;index++)
{
elements[index] = float.Parse(Console.ReadLine());
}
Console.Write("\n已经排序的数组\n");
for(index=0;index<elements.Length;index++)
{
for(int j=index+1;j<elements.Length;j++)
{
if(elements[index]>elements[j])
{
temp = elements[index];
elements[index] = elements[j];
elements[j] = temp;
}
}
Console.WriteLine(elements[index]);
}
Console.ReadKey();
}
}
}
