Advertisement
Razorspined

Untitled

Nov 11th, 2016
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.75 KB | None | 0 0
  1. static void Main(string[] args)
  2.         {
  3.             int[,] a = new int[,] {
  4.                 {1,1,1,0,0,0},
  5.                 {0,1,0,0,0,0},
  6.                 {1,1,1,0,0,0},
  7.                 {0,0,2,4,4,0},
  8.                 {0,0,0,2,0,0},
  9.                 {0,0,1,2,4,0}
  10.             };
  11.  
  12.             int col = 0; int ind = 0; int currHighest = 0;
  13.             while (col < 4)
  14.             {
  15.                 currHighest = a[col, ind] + a[col, ind+1] + a[col,ind+2] + a[col+1,ind+1] + a[col+2,ind] + a[col+2,ind+1] + a[col+2,ind+2];
  16.                 ind++;
  17.                 Console.WriteLine(currHighest);
  18.                 if (ind == 4)
  19.                 {
  20.                     ind = 0; col++;
  21.                 }
  22.             }
  23.             Console.ReadLine();
  24.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement