1 for (int k=1;i<=n;i++){ 2 for (int i=1;i<=n;i++){ 3 for (int j=1;j<=n;j++){ 4 f[i][j]=min(f[i][j],f[i][k]+f[k][j]); 5 } 6 } 7 }
1 for (int k=1;i<=n;i++){ 2 for (int i=1;i<=n;i++){ 3 for (int j=1;j<=n;j++){ 4 f[i][j]=min(f[i][j],f[i][k]+f[k][j]); 5 } 6 } 7 }