摘要: out参数: 参数在方法的内部必须为其赋值;可以同时返回不同类型的值; 在Main方法里定义,在方法里赋值; 输出最大值_最小值_总和_平均值 static void Main(string[] args) { int[] arr = { 5, 12, -6, -9, 7, 2 }; int max 阅读全文
posted @ 2017-10-19 20:06 雪wolf 阅读(433) 评论(0) 推荐(0) 编辑
摘要: 重载:方法名相同,参数个数可能相同,也可能不相同,但是类型不同,返回值类型不同; 例如:public static int M(int n1,int n2){} public static int M(int n1,int n2,int n3){} public static string M(st 阅读全文
posted @ 2017-10-19 19:55 雪wolf 阅读(117) 评论(0) 推荐(0) 编辑
摘要: static void Main(string[] args) { int[] arr = { -2,5,-6,9,3,7}; Wz(arr); } public static void Wz(int[] arr) { for (int i = 0; i < arr.Length/2; i++) { 阅读全文
posted @ 2017-10-19 19:42 雪wolf 阅读(1245) 评论(0) 推荐(0) 编辑
摘要: static void Main(string[] args) { int[] arr = {5,6,-2,3,9,7,1,-6 }; Px(arr); } public static void Px(int[] arr) { for (int i = 0; i < arr.Length-1; i+ 阅读全文
posted @ 2017-10-19 19:37 雪wolf 阅读(98) 评论(0) 推荐(0) 编辑