[2021-07-05]floyed Eicy 2023-01-14 (Updated: 2023-12-18) C++ 算法 1234567891011121314151617181920210 3 4 5 0 83 2 0g[1][2]=3for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++) { for(int k=1;k<=n;k++) { if(i!=j&&i) { if(f[i][j]>g[i][k]+g[k][j]) { f[i][j]=g[i][k]+g[k][j]; } } } }}