Language: C++

int mincost[MAX_V]; //集合Xからの最小コスト
bool used[MAX_V]; //頂点iがxに含まれているか
int m; //頂点数

using namespace std;

int main(){
  int n,i,c,j,a,b;
  
  while(1){
    scanf("%d",&n); if(n==0) break;
 scanf("%d",&m);
    for(j=0;j<m;j++){
      for(i=0;i<m;++i){
	cost[j][i]=INF;
      }
    }
    for(i=0;i<m;i++){
      scanf("%d,%d",&a,&b); scanf(",%d",&c);
      cost[a][b]=c/100-1;
      cost[b][a]=c/100-1;
    }
    printf("%d\n",prim());
    
  }
  return 0;
}

int prim(){
  
  //初期化
  for(int i=0;i<m;++i){
    mincost[i]=INF;
    used[i]=false;
  }
  
  mincost[0]=0;
  int res=0;
  
  while(true){
    int v=-1;
    //xに属さない頂点のうちxからの辺のコストが最小になる頂点を探す
    for(int u=0;u<m;u++){
      if(!used[u]&&(v==-1||mincost[u]<mincost[v])) v=u;
    }
    if(v==-1) break;
    
    used[v]=true; //頂点vをxに追加
    res+=mincost[v]; //辺のコストを比べる
    
    for(int u=0;u<m;u++){
      mincost[u]=min(mincost[u],cost[v][u]);
    }
  }
  return res;
}

Compiler output:
a.cc:1:13: error: 'MAX_V' was not declared in this scope
    1 | int mincost[MAX_V]; //集合Xからの最小コスト
      |             ^~~~~
a.cc:2:11: error: 'MAX_V' was not declared in this scope
    2 | bool used[MAX_V]; //頂点iがxに含まれているか
      |           ^~~~~
a.cc: In function 'int main()':
a.cc:11:5: error: 'scanf' was not declared in this scope
   11 |     scanf("%d",&n); if(n==0) break;
      |     ^~~~~
a.cc:15:9: error: 'cost' was not declared in this scope; did you mean 'const'?
   15 |         cost[j][i]=INF;
      |         ^~~~
      |         const
a.cc:15:20: error: 'INF' was not declared in this scope
   15 |         cost[j][i]=INF;
      |                    ^~~
a.cc:20:7: error: 'cost' was not declared in this scope; did you mean 'const'?
   20 |       cost[a][b]=c/100-1;
      |       ^~~~
      |       const
a.cc:23:19: error: 'prim' was not declared in this scope
   23 |     printf("%d\n",prim());
      |                   ^~~~
a.cc:23:5: error: 'printf' was not declared in this scope
   23 |     printf("%d\n",prim());
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int mincost[MAX_V]; //集合Xからの最小コスト
a.cc: In function 'int prim()':
a.cc:33:5: error: 'mincost' was not declared in this scope
   33 |     mincost[i]=INF;
      |     ^~~~~~~
a.cc:33:16: error: 'INF' was not declared in this scope
   33 |     mincost[i]=INF;
      |                ^~~
a.cc:34:5: error: 'used' was not declared in this scope
   34 |     used[i]=false;
      |     ^~~~
a.cc:37:3: error: 'mincost' was not declared in this scope
   37 |   mincost[0]=0;
      |   ^~~~~~~
a.cc:44:11: error: 'used' was not declared in this scope
   44 |       if(!used[u]&&(v==-1||mincost[u]<mincost[v])) v=u;
      |           ^~~~
a.cc:48:5: error: 'used' was not declared in this scope
   48 |     used[v]=true; //頂点vをxに追加
      |     ^~~~
a.cc:52:33: error: 'cost' was not declared in this scope; did you mean 'const'?
   52 |       mincost[u]=min(mincost[u],cost[v][u]);
      |                                 ^~~~
      |                                 const
a.cc:52:18: error: 'min' was not declared in this scope; did you mean 'main'?
   52 |       mincost[u]=min(mincost[u],cost[v][u]);
      |                  ^~~
      |                  main