程序一(在主函数中实现):
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication7 { class Program { static void Main(string[] args) { int[] a = new int[10]; for (int i = 0; i < a.Length; i++) a[i] = int.Parse(Console.ReadLine()); for (int i = 0; i < a.Length; i++) { if (a[0] < a[i]) a[0] = a[i]; if (a[0] > a[i]) a[1] = a[i]; } Console.WriteLine("最大值是:{0}", a[0]); &nbs