in the code below that belongs to the floyd algorithm, how can I print the output for each i, j value? for example, the shortest distance [0,0] = 2 and the shortest [0,1] = 4, etc. now it prints the shortest distance from i to j: 3 (for example)
private void button10_Click(object sender, EventArgs e) { string ab = textBox11.Text; int matrixDimention = Convert.ToInt32(ab); int[,] intValues = new int[matrixDimention, matrixDimention]; string[] splitValues = textBox9.Text.Split(','); for (int i = 0; i < splitValues.Length; i++) intValues[i / (matrixDimention), i % (matrixDimention)] = Convert.ToInt32(splitValues[i]); string displayString = ""; for (int inner = 0; inner < intValues.GetLength(0); inner++) { for (int outer = 0; outer < intValues.GetLength(0); outer++) displayString += String.Format("{0}\t", intValues[inner, outer]); displayString += Environment.NewLine; } int n=matrixDimension MessageBox.Show("matrix"+strn+ "in" + strn + "is\n\n\n" +displayString);
Arash source share