using System;
public class SelectionSorter
{
  // public enum comp {COMP_LESS,COMP_EQUAL,COMP_GRTR};
  private int min;
  // private int m=0;
   public void Sort(int [] list)
   {
       for(int i=0;i<list.Length-1;++i)
       {
          min=i;
          for(int j=i+1;j<list.Length;++j)
          {
            if(list[j]<list[min])
            min=j;
          }
        int t=list[min];
        list[min]=list[i];
        list[i]=t;
     //   Console.WriteLine("{0}",list[i]);
     }

    }
}
public class MainClass
{
     public static void Main()
    {
     int[] iArrary=new int[]{1,5,3,6,10,55,9,2,87,12,34,75,33,47};
     SelectionSorter ss=new SelectionSorter();
     ss.Sort(iArrary);
     for(int m=0;m<=13;m++)
     Console.WriteLine("{0}",iArrary[m]);  
 
     }
}
    已经成功的编译。

相关文章:

  • 2021-09-15
  • 2022-12-23
  • 2021-06-15
  • 2021-11-27
  • 2021-10-26
  • 2021-09-30
  • 2021-11-27
猜你喜欢
  • 2021-06-07
  • 2021-11-27
  • 2022-01-19
  • 2022-02-12
  • 2022-03-05
  • 2021-09-17
  • 2022-02-15
相关资源
相似解决方案