Skip to content

Instantly share code, notes, and snippets.

@eneas
Created December 8, 2016 22:33
Show Gist options
  • Save eneas/b232dbcc4e5ce97813a1986900e22baa to your computer and use it in GitHub Desktop.
Save eneas/b232dbcc4e5ce97813a1986900e22baa to your computer and use it in GitHub Desktop.
using System;
using System.Linq;
namespace ConsoleApplication
{
public class Program
{
public static void Main(string[] args)
{
var ary = new int[]{1,2,4,5,3,4,7,16,2,4,9,1,6,3,0,2};
var mat = new int[4,4];
Buffer.BlockCopy(ary, 0, mat, 0, ary.Length * sizeof(int));
foreach(var i in Enumerable.Range(0,4))
{
foreach(var j in Enumerable.Range(0,4))
{
Console.Write("{0,-8}",mat[i,j]);
}
Console.Write("\n");
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment