func_code_string: #include <bits/stdc++.h>   using namespace std;   const int lim = 500000001;   class TMain {    private:     int n, m, f[505][505], dis[505][505], ans[505][505], now[505];       public:     int run() {       scanf( %d %d , &n, &m);       for (int i = 1; i <= n; i++)         for (int j = 1; j <= n; j++)           if (i == j)             f[i][j] = dis[i][j] = 0;           else             f[i][j] = dis[i][j] = lim;       for (int i = 1; i <= m; i++) {         int a, b, c;         scanf( %d %d %d , &a, &b, &c);         dis[a][b] = dis[b][a] = f[a][b] = f[b][a] = min(f[a][b], c);       }       for (int k = 1; k <= n; k++)         for (int i = 1; i <= n; i++)           for (int j = 1; j <= n; j++) f[i][j] = min(f[i][j], f[i][k] + f[k][j]);       for (int i = 1; i <= n; i++) {         for (int j = 1; j <= n; j++) now[j] = 0;         for (int j = 1; j <= n; j++)           for (int k = 1; k <= n; k++)             if (j != k && f[i][j] + dis[j][k] == f[i][k]) now[k]++;         for (int j = 1; j <= n; j++)           for (int k = 1; k <= n; k++)             if (f[i][j] + f[j][k] == f[i][k]) ans[i][k] += now[j];       }       for (int i = 1; i < n; i++)         for (int j = i + 1; j <= n; j++)           if (f[i][j] == lim)             printf( 0  );           else             printf( %d  , ans[i][j]);       printf(  n );       return 0;     }   } Main;   int main() { return Main.run(); }   