
Code: Alles auswählen
static void Main(string[] args)
{
List<int> range = new List<int>() { 5, 9, 3, 1, 7 };
int max = 0;
range.ForEach(x => { max = x >= max ? x : max; });
Console.WriteLine(max);
}
Code: Alles auswählen
static void Main(string[] args)
{
List<int> range = new List<int>() { 5, 9, 3, 1, 7 };
int max = 0;
range.ForEach(x => { max = x >= max ? x : max; });
Console.WriteLine(max);
}