随笔分类 -  常用算法汇总

汇总常用的基本算法的应用举例
摘要:static void Main(string[] args) { /* * * 1 * 1 1 * 1 2 1 * 1 3 3 1 * 1 4 6 4 1 * 1 5 10 10 5 1 */ int[,]arry=new int[6,6]; for (int i = 0; i < 6; i++) { arry[i, 0] = 1; arry[i, i] = 1; for (int j = 1; j < i+1; j++) { arry[i,j]=arry[i-1,j-1]+arry[i-1,j]; } } for(int i=0;i<6;i++) { for(int j= 阅读全文
posted @ 2012-02-27 15:51 木子易 阅读(173) 评论(0) 推荐(0)
摘要:static void Main(string[] args) { int[]a= Read();//读数据 Sort(ref a);//排序 Write(a);//输出数据 }读数据 1 /// <summary> 2 /// 读数据 3 /// </summary> 4 /// <returns></returns> 5 public static int[] Read() 6 { 7 int i; 8 9 int[] a = new int[5];10 for (... 阅读全文
posted @ 2012-02-27 09:44 木子易 阅读(406) 评论(0) 推荐(0)