C# advance, Multidimensional Arrays - Exercise, 2. Squares in Matrix
Ако може някой да ми помогне не мога да разбера защо не взимам 100/100.
using System;
using System.Linq;
namespace Tets21
{
internal class Program
{
static void Main(string[] args)
{
int[] num = Console.ReadLine().Split(' ', StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();
int row = num[0];
int col = num[1];
char[,] symbols = new char[row, col];
for (int i = 0; i < symbols.GetLength(0); i++)
{
char[] sym = Console.ReadLine().Split(' ', StringSplitOptions.RemoveEmptyEntries).Select(char.Parse).ToArray();
for (int y = 0; y < symbols.GetLength(1); y++)
{
symbols[i, y] = sym[y];
}
}
int number = 0;
for (int i = 0; i < symbols.GetLength(0) - 1; i++)
{
for (int y = 0; y < symbols.GetLength(1) - 1; y++)
{
if (symbols[i, y] == symbols[i, y + 1] && symbols[i, y] == symbols[i + 1, i + 1] && symbols[i, y] == symbols[i + 1, y])
{
number++;
}
}
}
Console.WriteLine(number);
}
}
}