跪求冒泡法实现排序的C#控制台应用程序代码。

[复制链接]
查看11 | 回复3 | 2011-11-16 16:20:29 | 显示全部楼层 |阅读模式
把字符串数组变成整形数组:string[] array_str = strNums.Split(',');int[] array_int = new int[ array_str .Length] ;for(int i = 0;i< array_str.Length;i++){array_int = int.Parse( array_str);}然后在下面用array_int就可以了...
回复

使用道具 举报

千问 | 2011-11-16 16:20:29 | 显示全部楼层
这2个类型不能直接转的。
string[] i = strNums.Split(',');;
int[] Array_str = new int[i.Length];
for (int a = 0; a < i.Length; a++)
{
...
回复

使用道具 举报

千问 | 2011-11-16 16:20:29 | 显示全部楼层
晕,我怎么从来没有在冒泡算法中使用goto过,不就是两个循环交换就拉倒了。...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行