62,041
社区成员
发帖
与我相关
我的任务
分享
private void button1_Click(object sender, EventArgs e)
{
int[] a = { 5, 7, 23, 37, 13, 83 };
int[] b = GetFiveMax(a);
}
public int[] GetFiveMax(int[] array)
{
Array.Sort<int>(array, new Comparison<int>(func));
Array reArray = new int[5];
Array.Copy(array, reArray, 5);
return (int[])reArray;
}
public int func(int a, int b)
{
return b - a;
}