using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication9 { class Program { static int maxvalue(int[] intarray) { ]; ; i < intarray.Length; i++) { if (maxval<intarray[i]) { maxval = intarray[i]; } } return maxval; } static void Main(string[] args) { , , , , , , , , , , , , , }; int a = maxvalue(array); Console.WriteLine("该数组最大值为{0}", a); Console.ReadKey(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication10 { class Program { static int sumvalus(params int[] vals) { ; ; i < vals.Length; i++) { sum += vals[i]; } return sum; } static void Main(string[] args) { , , , , , , , , }; int sum = sumvalus(array); Console.WriteLine("数组之和为{0}", sum); Console.ReadKey(); } } }