常用的asp.net代码,发出来 学习了,先谢谢大家了!
解决方案 »
- 求全局静态详解
- 一个js调用的一个flash按钮,在我们360浏览器上都可以显示,在别人360浏览器就是显示不出来
- 一个源于GridView的问题,如何获取到GridView内模版列内空间的Text的数值 在线等 请各位指点一下!!!!!!!!!!
- 关于Session_End事件能否处理cookie的问题?
- C# MVC中 获取访问地址。。。在线等~
- DIV在ASPX.CS中如何设置为显示?
- 100分求教多线程的问题
- 我想在线删除压缩包中的*.ASP文件,为什么不成功呀
- 我疯了,高人救我
- 简单问题
- dropdownlist.selectedindexchanged
- asp.net http传递参数的问题
class EbullitionSorter
{
public void Sort(int[] arr)
{
int i, j, temp;
bool done = false;
j = 1;
while ((j < arr.Length) && (!done))//判断长度
{
done = true;
for (i = 0; i < arr.Length - j; i++)
{
if (arr[i] > arr[i + 1])
{
done = false;
temp = arr[i];
arr[i] = arr[i + 1];//交换数据
arr[i + 1] = temp;
}
}
j++;
}
}
static void Main(string[] args)
{
int[] array = new int[] { 1, 5, 3, 6, 10, 55, 9, 2, 87, 12, 34, 75, 33, 47 };
EbullitionSorter e = new EbullitionSorter ();
e.Sort(array);
foreach (int m in array)
Console.WriteLine("{0}", m);
}
public class InsertionSorter
{
public void Sort(int[] arr)
{
for (int i = 1; i < arr.Length; i++)
{
int t = arr[i];
int j = i;
while ((j > 0) && (arr[j - 1] > t))
{
arr[j] = arr[j - 1];//交换顺序
--j;
}
arr[j] = t;
}
}
static void Main(string[] args)
{
int[] array = new int[] { 1, 5, 3, 6, 10, 55, 9, 2, 87, 12, 34, 75, 33, 47 };
InsertionSorter i = new InsertionSorter();
i.Sort(array);
foreach (int m in array)
Console.WriteLine("{0}", m);
}
}