下面程序中用来求数组和。请在下面程序的横线处填上适当内容 以使程序完整 并使程序的输出为:s=15

大学网课 已帮助 人

下面程序中用来求数组和。请在下面程序的横线处填上适当内容,以使程序完整,并使程序的输出为:s=150。 public class Arr { int[] a = new int[] { }; int n; public Arr(int[] aa, int nn) { n = nn; a = new int[n]; for (int i = 0; i < n; i++) a[i] = aa[i]; } public _____1_____ { return a[i]; } } class Program { static void Main(string[] args) { int[] b = new int[] { 10, 20, 30, 40, 50 }; Arr a1 = new Arr(b, 5); int i = 0, s = 0; for (; i < 5; i++) _____2_____; Console.WriteLine("s={0}",s); } }

下面程序中用来求数组和。请在下面程序的横线处填上适当内容 以使程序完整 并使程序的输出为:s=15

热搜:下面程序的功能是输出数组s中最大元素