摘要: 冒泡排序 bubble sortingint t;int[] a ={21,56,64,94,97,123};for(int j =a.Length-1;j>0;j--){for(int i =0;i<j;i++){ if(a[i]>a[i+1]){ t =a[i];a[i]=a[i+1];a[i+1]=t;}}}for(int u =0;u<a.Length;u++)Console.WriteLine(a[u]);结果:21,56,64,94,97,123同时找最大最小int temp;int[] a={56,66,5,1230,87,95};for(int i =0 阅读全文
posted @ 2012-08-15 12:06 ecollab 阅读(475) 评论(0) 推荐(0) 编辑