Difference between revisions of "CSharp: Minimo, máximo e média"

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

Latest revision as of 18:03, 26 May 2009

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());
		}
	}
}