Контрольная работа: Многокритериальные задачи. Метод альтернативных решений
class Writer
{
private static string fileName;
private static string[] outputTxt;
private static double[,] matrix;
private static string[,] matrix1;
private static int row;
private static int col;
private static System.Globalization.NumberFormatInfo numberFormat;
public static void WriteTable(string nameFile, double[,] table)
{
Writer.fileName = nameFile;
Writer.matrix = table;
if (Writer.matrix != null)
{
row = matrix.GetLength(0);
col = matrix.GetLength(1);
outputTxt = new string[row];
for (int i = 0; i < row; i++)
{
for (int j = 0; j < col; j++)
{
outputTxt[i] += matrix[i, j].ToString();
if(j != (col - 1))
outputTxt[i] += " ";
}
}
File.WriteAllLines(nameFile, outputTxt);
}