| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 730 人关注过本帖
标题:c#问题
只看楼主 加入收藏
riiaqq11
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2007-11-16
收藏
 问题点数:0 回复次数:7 
c#问题

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]);
}

}
}
}

搜索更多相关主题的帖子: public 
2007-11-16 14:35
ou108
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2007-11-15
收藏
得分:0 

这是什么问题啊

2007-11-16 15:26
guiqian145
Rank: 1
等 级:新手上路
帖 子:69
专家分:0
注 册:2007-11-9
收藏
得分:0 

晕糊

2007-11-16 15:55
riiaqq11
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2007-11-16
收藏
得分:0 
程序出错
2007-11-16 16:04
aresoft
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2007-11-16
收藏
得分:0 
回复:(riiaqq11)c#问题
什么和什么??
2007-11-16 16:06
luntan2007
Rank: 1
等 级:新手上路
帖 子:29
专家分:0
注 册:2007-11-16
收藏
得分:0 
能不能说明下你的程序问题呢?那里有问题呢?这样坛友才能知道怎么帮你去看呀
就一个程序放上面怎么去解决呀!!!
2007-11-16 17:24
riiaqq11
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2007-11-16
收藏
得分:0 

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

2007-11-16 17:49
lijiao
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2007-11-16
收藏
得分:0 

断点测试啊


2007-11-16 18:50
快速回复:c#问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.019497 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved