CSharp: Minimo, máximo e média
From AdonaiMedrado.Pro.Br
Revision as of 18:03, 26 May 2009 by Adonaimedrado (Talk | contribs) (New page: <code lang="csharp"> using System; using System.Collections.Generic; using System.Linq; namespace MinimoMaximoMedia { class Program { public static void Main(string[] args) { int...)
using System; using System.Collections.Generic; using System.Linq; namespace MinimoMaximoMedia { class Program { public static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); List<int> l = new List<int>(); for(int i = 0; i < n; i++) l.Add(int.Parse(Console.ReadLine())); Console.WriteLine(l.Min()); Console.WriteLine(l.Max()); Console.WriteLine(l.Average()); } } }