C#把一个int数组的数字从小到大排列
来源:互联网 发布:淘宝联盟怎么申请推广 编辑:程序博客网 时间:2024/05/22 01:42
using System;
namespace ConsoleApplication1
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
class Class1
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
MinToMax mtm = new MinToMax();
int[] array = { 1, 2, 6, 3, 8, 3, 4, 0, 5, 23, 52, 12, 234, 235, 1232, 21, 234, 123, 143, 1368 };
int[] last = mtm.MTM(array);
int n = 0;
for (int i = 0; i < array.Length; i++)
{
System.Console.Write(last[i] + "<");
++n;
}
System.Console.WriteLine("/n总共{0}个数字", n);
System.Console.ReadLine();
//
// TODO: 在此处添加代码以启动应用程序
//
}
}
public class MinToMax
{
public int[] MTM(int[] array)
{
int[] FianlMTM = new int[array.Length];
for (int j = 0; j < array.Length; j++)
{
int last = 0;
for (int i = 1; i < array.Length - j; i++)
{
int t = array[i];
if ((array[i]) < (array[i - 1]))
{
array[i] = array[i - 1];
last = array[i];
array[i - 1] = t;
}
else
last = array[i];
}
FianlMTM[array.Length - (j + 1)] = last;
}
return FianlMTM;
}
}
}
- C#把一个int数组的数字从小到大排列
- C#把一个int数组的数字从小到大排列
- 把一个int数组的数字从小到大排列(C#)(原创)
- 把一个int数组的数字从小到大排列(C#)
- 数组从小到大排列
- 两个从小到大的数组组合成一个从小到大的数组
- 15个数字排列从小到大
- 怎么把数组转递给方法,并返回按从小到大排列后,返回数组!
- 一个数字数组中所有的排列(java)
- queue vector greater <int> 从小到大排列
- c#面试题 查找整型数组中重复出现次数最多的数字,次数相同数字按从小到大排序
- 写一个数组从小到大的排序
- 将一个数组按从小到大的顺序排列
- 一个有序数组(从小到大排列),数组中的数据有正有负,求这个数组中的最小绝对值
- 一个有序数组(从小到大排列),数组中的数据有正有负,求这个数组中的最小绝对值。
- 请把一个整形数组中重复的数字去掉
- 把一个整形数组中重复的数字去掉
- [算法]_[对数组内的数字进行从小到大排序]
- 成绩差的同学为何大多当了老板?
- liunx系统中的几个命令
- C# A*算法实现8数或者15数问题
- Module 3 Architecture
- C#深度和广度优先分油问题
- C#把一个int数组的数字从小到大排列
- 不允许从数据类型varchar到数据类型money的隐性转换
- 转:VMware虚拟机中Linux系统如何设置网卡
- 使用twisted.python.log日志
- 皇后问题
- 获取html中的文本数据
- Oracle10g 占用8080端口与Jboss冲突解决方法
- C#解号称爱因斯坦出的智力题
- 微软收购网络广告公司aQuantive(转)