CSharp: Quantidade mínima, máxima e média de caracteres

From AdonaiMedrado.Pro.Br
Revision as of 18:07, 26 May 2009 by Adonaimedrado (Talk | contribs) (New page: <code lang="csharp"> using System; using System.Collections.Generic; using System.Linq; namespace QuantidadeDeCaracteres { class Program { public static void Main(string[] args) { ...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
using System;
using System.Collections.Generic;
using System.Linq;
 
namespace QuantidadeDeCaracteres
{
	class Program
	{
		public static void Main(string[] args)
		{
			int n = int.Parse(Console.ReadLine());
			List<string> l = new List<string>();
 
			for(int i = 0; i < n; i++)
				l.Add(Console.ReadLine());
 
  	                Console.WriteLine(l.Min(x=>x.Length));
  	                Console.WriteLine(l.Max(x=>x.Length));
  	                Console.WriteLine(l.Average(x=>x.Length));
		}
	}
}