fork download
  1. using System;
  2. using System.Linq;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5.  
  6. public class Test
  7. {
  8. public static void Main()
  9. {
  10. Int32 x = 5;
  11.  
  12. if (x == 1 || x == 2 || x == 5 || x == 13 || x == 14){
  13. Console.WriteLine("Elongated If: Match!");
  14. }
  15.  
  16. Int32[] test = new[]{1, 2, 5, 13, 14};
  17.  
  18. if (test.Contains(x)){
  19. Console.WriteLine("LINQ: Match!");
  20. }
  21.  
  22. if ((new ArrayList(test)).Contains(x)){
  23. Console.WriteLine("ArrayList: Match!");
  24. }
  25.  
  26. if ((new List<Int32>(test)).Contains(x)){
  27. Console.WriteLine("List: Match!");
  28. }
  29. }
  30. }
Success #stdin #stdout 0.04s 37080KB
stdin
Standard input is empty
stdout
Elongated If: Match!
LINQ: Match!
ArrayList: Match!
List: Match!