Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void Átlós()
- {
- int i = 1;
- int j = 1;
- while ((i != tomb.GetLength(0) - 1) && (j != tomb.GetLength(1) -1))
- {
- for (int a = i-1; a < i+1; a++)
- {
- for (int b = j-1; b < j+1; b++)
- {
- if (tomb[a, b] == 1)
- {
- lehet = false;
- }
- }
- if (lehet == false)
- {
- if ((tomb[i, j] == 1) && tomb[i, j + 1] == 1)
- {
- db3++;
- }
- else if ((tomb[i, j] == 1) && tomb[i, j - 1] == 1)
- {
- db3++;
- }
- }
- }
- i++;
- j++;
- }
- Console.WriteLine(db3);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement