private static void NonEqual()
{
if (_ncr > _nci)
{
for (int i = _nci; i < _stolbcov; i++)
{
if (_matrix[_nsi, i] % _stolbcov == _ncr)
{
_way = _tempway;
_input = _matrix[_nsi, i];
Calculation();
EqualColumns();
break;
}
else
{
_tempway.Add(_matrix[_nsi, i]);
}
}
}
else
{
for (int i = _nci; i >= 0; i--)
{
if (_matrix[_nsi, i] % _stolbcov == _ncr)
{
_way = _tempway;
_input = _matrix[_nsi, i];
Calculation();
EqualColumns();
break;
}
else
{
_tempway.Add(_matrix[_nsi, i]);
}
}
}
}
private static void EqualColumns()
{
// Way.Add(Input);
if (_receiver > _input)
for (int j = _nsi; j < _strok; j++)
{
if (_matrix[j, _nci] == _receiver)
{
//Way.Add(matrix[j, NCI]);
break;
}
else
{
_way.Add(_matrix[j, _nci]);
}
}
else
{
for (int j = _nsi; j >= 0; j--)
{
if (_matrix[j, _nci] == _receiver)
{
//Way.Add(matrix[j, NCI]);
break;
}
else
{
_way.Add(_matrix[j, _nci]);
}
}
}
}
private static void EqualRows()
{
// Way.Add(Input);
if (_receiver > _input)
{
for (int j = _nci; j < _stolbcov; j++)
{
if (_matrix[_nsi, j] == _receiver)
{
//Way.Add(matrix[NSI, j]);
break;
}
else
{
_way.Add(_matrix[_nsi, j]);
}
}
}
else
{
for (int j = _nci; j >=0; j--)
{
if (_matrix[_nsi, j] == _receiver)
{
//Way.Add(matrix[NSI, j]);
break;
}
else
{
_way.Add(_matrix[_nsi, j]);
}
}
}
}
private static void FillingMatrix(int n, int m)
{
int stroka = n;
int stolbec = m;
_matrix = new int[stroka, stolbec];
int cnt = 0;
Console.WriteLine("исходная матрица:");
for (int i = 0; i < stroka; i++)
{
for (int j = 0; j < stolbec; j++)
{
_matrix[i, j] = cnt;
cnt++;
Console.Write(" "+_matrix[i, j] + "\t");
}
Console.WriteLine(Environment.NewLine);
}
}