摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication10{ class Program { static void Main(string[] args) { int[] intArr = { 8,2,5,9,4,1,3,7,-1}; MaxMin result = FindMaxAndMin(intArr, 0, intArr.Length... 阅读全文
posted @ 2014-02-04 16:10 Ligeance 阅读(1124) 评论(0) 推荐(0) 编辑
摘要: 方法是把数组中的数按2个2个的分成一组,先对比他们俩,然后再对比MAX和MIN。最后再加个判断,如果是奇数,那最后一个数字也要和MAX和MIN判断。using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication4{ class Program { static void Main(string[] args) { int[] input = { 1,2,-1,3,55,1}; ... 阅读全文
posted @ 2014-02-04 08:38 Ligeance 阅读(504) 评论(0) 推荐(0) 编辑