Created
December 8, 2016 22:33
-
-
Save eneas/b232dbcc4e5ce97813a1986900e22baa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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