手机
当前位置:查字典教程网 >编程开发 >asp.net教程 >asp.net下实现输入数字的冒泡排序
asp.net下实现输入数字的冒泡排序
摘要:复制代码代码如下:protectedvoidbtnSort_Click(objectsender,EventArgse){stringarr...

复制代码 代码如下:

protected void btnSort_Click(object sender, EventArgs e)

{

string array1 = txtSort.Text.Trim();

string[] array21=array1.Split(',');

int dxiao = array21.Length;

int[] array = new int[dxiao];

int temp=0;

for (int i = 0; i < array.Length; i++)

{

array[i] = Convert.ToInt32(array21[i]);

}

for (int i = 0; i < array.Length - 1; i++)

{

for (int j = i + 1; j < array.Length; j++)

{

if (array[j] < array[i])

{

temp = array[i];

array[i] = array[j];

array[j] = temp;

}

}

}

for (int i = 0; i < dxiao; i++)

{

lbsort.Text = lbsort.Text + " " + Convert.ToString(array[i]);

}

}

【asp.net下实现输入数字的冒泡排序】相关文章:

asp.net 购物车实现详细代码

Asp.net实现向上向下排序的例子

asp.net不用设置iis实现url重写

asp.net学习中发现的比较完整的流程

asp.net下 jquery jason 高效传输数据

asp.net post方法中参数取不出来的解决方法

asp.net中导出excel数据的方法汇总

Asp.net配合easyui实现返回json数据实例

asp.net实现C#绘制太极图的方法

asp.net下大文件上传知识整理

精品推荐
分类导航