SHARE
TWEET

Untitled

a guest Sep 17th, 2015 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         static void PrintArray(int[,] array)
  2.         {
  3.             int row = array.GetLength(0);
  4.             int col = array.GetLength(1);
  5.             double max = Math.Floor(Math.Log10(array.Cast<int>().Max())) + 1;
  6.  
  7.             for (int r = 0; r < row; r++)
  8.             {
  9.                 for (int c = 0; c < col; c++)
  10.                 {
  11.                     for (int ws = 1; ws <= ( max - Math.Floor( Math.Log10(array[r, c] ))); ws++)
  12.                     {
  13.                         Console.Write(" ");
  14.                     }
  15.                     Console.Write(array[r, c]);
  16.                 }
  17.                 Console.WriteLine("");
  18.             }
  19.             Console.WriteLine("");
  20.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top