Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void PrintArray(int[,] array)
- {
- int row = array.GetLength(0);
- int col = array.GetLength(1);
- double max = Math.Floor(Math.Log10(array.Cast<int>().Max())) + 1;
- for (int r = 0; r < row; r++)
- {
- for (int c = 0; c < col; c++)
- {
- for (int ws = 1; ws <= ( max - Math.Floor( Math.Log10(array[r, c] ))); ws++)
- {
- Console.Write(" ");
- }
- Console.Write(array[r, c]);
- }
- Console.WriteLine("");
- }
- Console.WriteLine("");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement