Professional Documents
Culture Documents
code tinh Nghịch đảo khóa K
code tinh Nghịch đảo khóa K
code tinh Nghịch đảo khóa K
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Ma_Hill
{
class mymatric
{
else
{
for (int j = 0; j < array.GetLength(1); j++)
{
int[,] tempArr = fillNewArr(array, 0, j);
det += array[0, j]*(int)Math.Pow(-1,j)*determinant(tempArr, Z);
}
}
det = det % Z;
if(det<0) det=det+Z;
return det;
}
total = total % Z;
temp[i] = total;
}
return temp;
}
//Hàm in ma tr?n
public static string M_to_string(int[,] arr)
{
string str_out="";;
for (int i = 0; i < arr.GetLength(0); i++)
for (int j = 0; j < arr.GetLength(1); j++)
str_out += arr[i, j] + ",";
str_out = str_out.Remove(str_out.Length-1, 1);
return str_out;
}
}
}