Difference between revisions of "CSharp: Sucessores ordenados"
From AdonaiMedrado.Pro.Br
(New page: <code lang="csharp"> using System; using System.Linq; using System.Collections.Generic; namespace SucessoresOrdenados { class Program { public static void Main(string[] args) { i...) |
(No difference)
|
Latest revision as of 17:57, 26 May 2009
using System; using System.Linq; using System.Collections.Generic; namespace SucessoresOrdenados { class Program { public static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); System.Collections.Generic.List<int> l = new System.Collections.Generic.List<int>(); for(int i = 0;i < n; i++) l.Add(int.Parse(Console.ReadLine())); IEnumerable<int> res = from k in l orderby k select k+1; foreach(int k in res) Console.WriteLine(k); } } }