title: Print 2D list in console in C#
body: <p>I have following code.</p>
  <pre class="lang-cs prettyprint-override"><code>class Solution
  {
      static void Main(String[] args)
      {
          var matrix = new List&lt;List&lt;int&gt;&gt;();
          for (int i = 0; i &lt; 6; ++i)
          {
              string[] elements = Console.ReadLine().Split(' ');
              matrix.Add(new List&lt;int&gt;());
              foreach (var item in elements)
              {
                  matrix[i].Add(int.Parse(item));
              }
          }
      }
  }
  </code></pre>
  <p>I know to print out the array which we read from console, convert it to int from string, we will have to use foreach loop. But here to print out the list in the console how can we write the code?</p>