fork download
  1. using System;
  2. using System.Collections;
  3. using System.Linq;
  4.  
  5. public class Test {
  6. public static void Main() {
  7. Random random = new Random();
  8.  
  9. var values = Enumerable
  10. .Range(1, 20)
  11. .Select(n => random.Next(1, 50))
  12. .ToArray();
  13.  
  14. var output = string.Join(
  15. Environment.NewLine,
  16. values.Where(x => x % 2 == 0)
  17. );
  18.  
  19. Console.WriteLine(output);
  20. }
  21. }
Success #stdin #stdout 0.01s 29808KB
stdin
Standard input is empty
stdout
30
10
24
12
28
20
34
10
48
4
6