fork download
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4.  
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. List<int> a = new List<int>();
  10. List<int> b = new List<int>();
  11.  
  12. for ( int i = 3; i <= 6; ++i )
  13. a.Add(i);
  14. for ( int i = 5; i <= 8; ++i )
  15. b.Add(i);
  16.  
  17. IList<int> a_without_b, b_without_a;
  18. a_without_b = a.Except(b).ToList();
  19. b_without_a = b.Except(a).ToList();
  20.  
  21. foreach ( IList<int> l in new IList<int>[]{a_without_b,b_without_a})
  22. Console.WriteLine(string.Join(",", l.Select(x=>x.ToString()).ToArray()));
  23. }
  24. }
Success #stdin #stdout 0.05s 34104KB
stdin
Standard input is empty
stdout
3,4
7,8