1 struct stortest_Floyd { 2 int a[5000][5000]; 3 void floyd(int num) { 4 for (int k = 1; k <= num; k++) { 5 for (int i = 1; i <= num; i++) { 6 for (int j = 1; j <= num; j++) { 7 if (a[i][j] > a[i][k] + a[k][j]) { 8 a[i][j] = a[i][k] + a[k][j]; 9 } 10 } 11 } 12 } 13 } 14 };