.NET Fiddle

CSharp · Console

/Program.cs

using System;
using System.Collections.Generic;

Test(new List<int>(){ 1, 2, 3, 4 });
Test(new List<int>(){ 2, 4, 6 });
Test(new List<int>(){ 1, 3, 5, 7, 9 });

static void Test(List<int> lst)
{
   Console.Write("Séquence : "); Afficher(lst);
   if(SontTous(lst, n => n % 2 == 0)) Console.WriteLine("Tous les éléments sont pairs");
   if(AuMoinsUn(lst, n => n % 2 == 0)) Console.WriteLine("Au moins un élément est pair");
   if(Aucun(lst, n => n % 2 == 0)) Console.WriteLine("Aucun élément n'est pair");
}
static void Afficher<T>(IEnumerable<T> elems)
{
   foreach(T e in elems)
      Console.Write($"{e} ");
   Console.WriteLine();
}
// précondition : src n'est pas vide
static bool SontTous<T>(IEnumerable<T> src, Func<T, bool> pred)
{
   foreach(T e in src)
      if(!pred(e))
         return false;
   return true;
}
// précondition : src n'est pas vide
static bool AuMoinsUn<T>(IEnumerable<T> src, Func<T, bool> pred) =>
	!SontTous(src, e => !pred(e));
// précondition : src n'est pas vide
static bool Aucun<T>(IEnumerable<T> src, Func<T, bool> pred) =>
   SontTous(src, e => !pred(e));
;