fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Globalization;
  4. using System.Linq;
  5.  
  6. namespace ConsoleApplication1
  7. {
  8. class Program
  9. {
  10. static IEnumerable<int> Range(int start, int end, int step = 1)
  11. {
  12. while (start <= end)
  13. {
  14. yield return start;
  15. start += step;
  16. }
  17. }
  18.  
  19. static void Main(string[] args)
  20. {
  21.  
  22. var output = from x in Range(0, 2)
  23. select from y in Range(0, 2)
  24. select String.Format("{0}, {1}", x, y);
  25.  
  26. output.ToList().ForEach(l => l.ToList().ForEach(Console.WriteLine) );
  27. }
  28. }
  29. }
  30.  
Success #stdin #stdout 0.04s 33864KB
stdin
Standard input is empty
stdout
0, 0
0, 1
0, 2
1, 0
1, 1
1, 2
2, 0
2, 1
2, 2