注册 登录
编程论坛 新人交流区

c#问题

riiaqq11 发布于 2007-11-16 14:35, 742 次点击

using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication27
{
public class sort
{
public static int[] tt = new int[size];
static int size = 10;
public sort()
{
for (int x = 0; x < 10; x++)
{
tt[x] = x;
Console.Write("{0},", tt[x]);
}
}

public delegate void go(int[] a);
public static void dosort(go b)
{
b(tt);
}
}
class sortprogram
{
public static void sx(int[] a)
{
for (int x = 0; x < a.Length - 1; x++)
{
for (int y = 0; y < a.Length - 1 - x; y++)
{
int temp;
if (a[y] > a[y + 1])
{
temp = a[y];
a[y] = a[y + 1];
a[y + 1] = temp;
}
}
}

}
}
class Program
{
static void Main(string[] args)
{

sort.go ss = new sort.go(sortprogram.sx);
sort.dosort(ss);
for (int x = 0; x < 10; x++)
{
Console.Write(sort.tt[x]);
}

}
}
}

7 回复
#2
ou1082007-11-16 15:26

这是什么问题啊

#3
guiqian1452007-11-16 15:55

晕糊

#4
riiaqq112007-11-16 16:04
程序出错
#5
aresoft2007-11-16 16:06
回复:(riiaqq11)c#问题
什么和什么??
#6
luntan20072007-11-16 17:24
能不能说明下你的程序问题呢?那里有问题呢?这样坛友才能知道怎么帮你去看呀
就一个程序放上面怎么去解决呀!!!
#7
riiaqq112007-11-16 17:49

这是一个排序的程序。可我运行后却发现超出了数组范围。我仔细检查了,却不能发现问题。好象没有超出数字范围啊!!

#8
lijiao2007-11-16 18:50

断点测试啊

1