标签:col code nbsp add summary line pre int ati
//直接上代码:
1 /// <summary> 2 /// 实现正负数重新排序 3 /// </summary> 4 /// <param name="arr"></param> 5 public static void ZhengfuSort(int[] arr) 6 { 7 List<int> list = new List<int>(); 8 foreach(var item in arr) 9 { 10 if(item<0) 11 { 12 list.Add(item); 13 } 14 } 15 foreach (var item in arr) 16 { 17 if (item > 0) 18 { 19 list.Add(item); 20 } 21 } 22 foreach (var item in list) 23 { 24 Console.WriteLine(item+","); 25 } 26 Console.ReadKey(); 27 }
标签:col code nbsp add summary line pre int ati
原文地址:https://www.cnblogs.com/luoshengjie/p/10366230.html