可以生成随机数,但是排序显示不出来结果,有没有大佬能帮我看看哪里出了问题
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace 随机数委托排序
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int[] a = new int[10];
delegate bool Compare(int x, int y);
void SortArray(Compare compare)
{
for (int i = 0; i < a.Length; i++)
{
for (int j = 0; j <= i; j++)
{
if(compare (a[i],a[j]))
{
int t = a[i];
a[i] = a[j];
a[j] = t;
}
}
}
}
bool Ascending(int x,int y)//比较x是否小于y