| 编程中国 | 业界新闻 | 技术文章 | 视频教程 | 下载频道 | 程序源码 | 个人空间 | 编程论坛
全能ASP/PHP/ASP.NET主机,支持月付专业 MSSQL 数据库空间,支持月付专业 MySQL 数据库空间,支持月付赛孚耐:软件保护加密专家
身份认证令牌USB KEY   
共有 207 人关注过本帖
标题:c#问题
收藏  订阅  推荐  打印 
riiaqq11
Rank: 1
等级:新手上路
帖子:3
积分:130
注册:2007-11-16
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]);
}

}
}
}

2007-11-16 14:35
ou108
Rank: 1
等级:新手上路
帖子:12
积分:220
注册:2007-11-15

这是什么问题啊

2007-11-16 15:26
guiqian145
Rank: 2
等级:注册会员
帖子:69
积分:880
注册:2007-11-9

晕糊

2007-11-16 15:55
riiaqq11
Rank: 1
等级:新手上路
帖子:3
积分:130
注册:2007-11-16

程序出错
2007-11-16 16:04
aresoft
Rank: 1
等级:新手上路
帖子:10
积分:200
注册:2007-11-16
回复:(riiaqq11)c#问题

什么和什么??
2007-11-16 16:06
luntan2007
Rank: 1
等级:新手上路
帖子:29
积分:402
注册:2007-11-16

能不能说明下你的程序问题呢?那里有问题呢?这样坛友才能知道怎么帮你去看呀
就一个程序放上面怎么去解决呀!!!
2007-11-16 17:24
riiaqq11
Rank: 1
等级:新手上路
帖子:3
积分:130
注册:2007-11-16

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

2007-11-16 17:49
lijiao
Rank: 1
等级:新手上路
帖子:10
积分:200
注册:2007-11-16

断点测试啊


2007-11-16 18:50
关于我们 | 广告合作 | 编程中国 | 清除Cookies | Archiver | WAP | TOP

编程中国 版权所有,并保留所有权利。鲁ICP备08000592号
Powered by Discuz, Processed in 0.072660 second(s), 9 queries.
Copyright©2004-2008, BCCN.NET, All Rights Reserved