CSharp: Minimo, máximo e média

From AdonaiMedrado.Pro.Br
Jump to: navigation, search
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());
		}
	}
}