//矩阵 ->字符串
StringBuilder strBuilder = new StringBuilder()
for (int i=0i<mi++)
for (int j=0j<nj++)
{
strBuilder.Append(matrix[i,j])
if (!(i==m-1 &&j==n-1))
strBuilder.Append(",")
}
String str = strBuilder.ToString()
//字符串 ->矩阵
get m
get n
int[,] matrix = new int[m, n]
String[] matrixValus = str.Split(new char[]{','})
for (int i=0i<mi++)
for (int j=0j<nj++)
matrix[i,j] = int.Parse(matrixValus[i*m + j])
CREATE TABLE matrix(
XNUMBER,
YNUMBER,
VALUENUMBER
)
/
--X,Y 可以确定矩阵中的一点,而VALUE就存放这点的值
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)