摘要:
1 int dist[Max][Max], path[Max][Max], cost[Max][Max]; 2 void Floyd(int n) 3 { 4 int i, j, k; 5 for (i=1; i<=n; i++) 6 for (j=1; j<=n; j++) 7 { 8 dist[i][j] = cost[i][j]; 9 if(i!=j && dist[i][j]<Maxint) 10 path[i][j] = i;11 else 12 pa... 阅读全文
摘要:
1 #include<stdio.h> 2 #include<stdlib.h> 3 #include<string.h> 4 #define Maxint 9999999 5 #define Max 101 6 7 int main() 8 { 9 int M, N, hotel[101], a, C, b, t;10 int i, j, k, r, sum, dist[101][101];11 12 while (scanf("%d%d",&N, &C) != EOF)13 {14 for (i=1; i<=N; 阅读全文