criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Scanner;

public class Main{
	public static void main(String[] args)throws Exception{
		new Main().solve();
	}
	void solve(){
		Scanner sc=new Scanner(System.in);
		while(sc.hasNext()){
			int n=sc.nextInt();//the number of roads
			Dijkstra ds=new Dijkstra(10);
			for(int i=0;i<n;i++){
				int from=sc.nextInt();
				int to=sc.nextInt();
				int cost=sc.nextInt();
				ds.addEdge(from, to, cost);
				ds.addEdge(to, from, cost);
			}
			long ans=99999999999L;
			long ans2=0;
			for(int i=0;i<n;i++){
				long a=ds.getShortestPath(i);
				if(a==0)continue;
				if(ans>a){
					ans=a;
					ans2=i;
				}
			}
			System.out.println(ans2+" "+ans);
		}
	}



	class Dijkstra{
		int n;
		long[] d;
		int s;
		PriorityQueue<Vertice> pq;
		final long INF=Long.MAX_VALUE/4;
		Dijkstra(int n){
			this.n=n;
			d=new long[n];
			@SuppressWarnings("unchecked")
			List<Edge>[]edges=new List[n];
			for(int i=0;i<n;i++){
				edges[i]=new ArrayList<Edge>();
			}
			s=-1;
		}
		public long getShortestPath(int i){
			if(i!=s){
				s=i;
				Arrays.fill(d, INF);
				d[i]=0;
				pq=new PriorityQueue<Vertice>();
				pq.add(new Vertice(i,d[i]));
				while(!pq.isEmpty()){
					Vertice u=pq.poll();
					if(d[u.me]<u.cost){
						continue;//skip old vertex
					}
					for(int ii=0;ii<edges[u.me].size();ii++){
						Edge e=edges[u.me].get(ii);
						if(d[e.from]!=INF&&e.cost+d[e.from]<d[e.to]){
							d[e.to]=e.cost+d[e.from];
							pq.add(new Vertice(e.to,d[e.to]));
						}else{
						}
					}
				}
				s=i;
			}
			int sum=0;
			for(int ii=0;ii<d.length;ii++){
				if(d[ii]==INF)continue;
				sum+=d[ii];
			}
			return sum;
		}
		void addEdge(int from,int to,long cost){
			edges[from].add(new Edge(from,to,cost));
		}
	}
	class Edge{
		int from;
		int to;
		long cost;
		Edge(int i,int j,long cost){
			this.from=i;
			this.to=j;
			this.cost=cost;
		}
	}
	class Vertice implements Comparable<Vertice>{
		int me;
		long cost;
		Vertice(int me,long cost){
			this.me=me;
			this.cost=cost;
		}
		@Override
		public int compareTo(Vertice o){
			return Long.compare(this.cost, o.cost);
		}
	}
	void tr(Object...o){System.out.println(Arrays.deepToString(o));}
}

Compiler output:
Main.java:67: error: cannot find symbol
					for(int ii=0;ii<edges[u.me].size();ii++){
					                ^
  symbol:   variable edges
  location: class Main.Dijkstra
Main.java:68: error: cannot find symbol
						Edge e=edges[u.me].get(ii);
						       ^
  symbol:   variable edges
  location: class Main.Dijkstra
Main.java:86: error: cannot find symbol
			edges[from].add(new Edge(from,to,cost));
			^
  symbol:   variable edges
  location: class Main.Dijkstra
3 errors
Language: Java

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Scanner;

public class Q0189 {
	public static void main(String[] args)throws Exception{
		new Q0189().solve();
	}
	void solve(){
		Scanner sc=new Scanner(System.in);
		while(true){
			int n=sc.nextInt();//the number of roads
			if(n==0){
				sc.close();
				break;
			}
			Dijkstra ds=new Dijkstra(10);
			for(int i=0;i<n;i++){
				int from=sc.nextInt();
				int to=sc.nextInt();
				int cost=sc.nextInt();
				ds.addEdge(from, to, cost);
				ds.addEdge(to, from, cost);
			}
			long ans=99999999999L;
			long ans2=0;
			for(int i=0;i<n;i++){
				long a=ds.getShortestPath(i);
				if(a==0)continue;
				if(ans>a){
					ans=a;
					ans2=i;
				}
			}
			System.out.println(ans2+" "+ans);
		}
	}



	class Dijkstra{
		int n;
		long[] d;
		int s;
		List<Edge>[]edges;
		PriorityQueue<Vertice> pq;
		final long INF=Long.MAX_VALUE/4;
		Dijkstra(int n){
			this.n=n;
			d=new long[n];
			@SuppressWarnings("unchecked")
			List<Edge>[]edges=new List[n];
			this.edges=edges;
			for(int i=0;i<n;i++){
				edges[i]=new ArrayList<Edge>();
			}
			s=-1;
		}
		public long getShortestPath(int i){
			if(i!=s){
				s=i;
				Arrays.fill(d, INF);
				d[i]=0;
				pq=new PriorityQueue<Vertice>();
				pq.add(new Vertice(i,d[i]));
				while(!pq.isEmpty()){
					Vertice u=pq.poll();
					if(d[u.me]<u.cost){
						continue;//skip old vertex
					}
					for(int ii=0;ii<edges[u.me].size();ii++){
						Edge e=edges[u.me].get(ii);
						if(d[e.from]!=INF&&e.cost+d[e.from]<d[e.to]){
							d[e.to]=e.cost+d[e.from];
							pq.add(new Vertice(e.to,d[e.to]));
						}else{
						}
					}
				}
				s=i;
			}
			int sum=0;
			for(int ii=0;ii<d.length;ii++){
				if(d[ii]==INF)continue;
				sum+=d[ii];
			}
			return sum;
		}
		void addEdge(int from,int to,long cost){
			edges[from].add(new Edge(from,to,cost));
		}
	}
	class Edge{
		int from;
		int to;
		long cost;
		Edge(int i,int j,long cost){
			this.from=i;
			this.to=j;
			this.cost=cost;
		}
	}
	class Vertice implements Comparable<Vertice>{
		int me;
		long cost;
		Vertice(int me,long cost){
			this.me=me;
			this.cost=cost;
		}
		@Override
		public int compareTo(Vertice o){
			return Long.compare(this.cost, o.cost);
		}
	}
	void tr(Object...o){System.out.println(Arrays.deepToString(o));}
}

Compiler output:
Main.java:7: error: class Q0189 is public, should be declared in a file named Q0189.java
public class Q0189 {
       ^
1 error
Language: Java

import java.util.List;
import java.util.ArrayList;
import java.util.Scanner;


public class Vol0189 {
	final static int INF = 100000000;
	final static int abmax = 10;
	
	public static void warshallFloyd(int v, int[][] d) {
		for (int k = 0; k < v; k++) {
			for (int i = 0; i < v; i++) {
				for (int j = 0; j < v; j++) {
					d[i][j] = Math.min(d[i][j], d[i][k] + d[k][j]);
				}
			}
		}
	}
	
	public static int length(int v, int p, int[][] d) {
		int sum = 0;
		for (int i = 0; i < v; i++) {
			sum += d[p][i];
		}
		return sum;
	}
	
	public static int[][] initialization() {
		int[][] d = new int[abmax][abmax];
		for (int i = 0; i < abmax; i++) {
			for (int j = 0; j < abmax; j++) {
				if (i == j)
					d[i][j] = 0;
				else
					d[i][j] = INF;
			}
		}
		return d;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.nextLine().split(" ")[0]);
		
		while (n != 0) {
			int[][] d = initialization();
			int v = 0;
			for (int i = 0; i < n; i++) {
				String str[] = sc.nextLine().split(" ");
				int a = Integer.parseInt(str[0]);
				int b = Integer.parseInt(str[1]);
				int c = Integer.parseInt(str[2]);
				d[a][b] = c;
				d[b][a] = c;
				v = Math.max(Math.max(v, a), b);
			}
			v = v + 1;
			warshallFloyd(v, d);
			int minv = 0;
			int minsum = INF;
			for (int i = 0; i < v; i++) {
				if (minsum > length(v, i, d)) {
					minv = i;
					minsum = length(v, i, d);
				}
			}
			System.out.println(minv + " " + minsum);
			n = Integer.parseInt(sc.nextLine().split(" ")[0]);
		}
		sc.close();
	}
}


Compiler output:
Main.java:6: error: class Vol0189 is public, should be declared in a file named Vol0189.java
public class Vol0189 {
       ^
1 error
Language: Java

import java.util.Scanner;

public class aoj0189 {

	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		
		while(true){
			int cyoten = sc.nextInt();
			if(cyoten==0) break;
			
			int mati=0;
			int miti[][] = new int[cyoten][3];
			
			
			for(int i=0; i<cyoten; i++){
				for(int j=0; j<3; j++){
					miti[i][j] = sc.nextInt();
					if(j<2){
					mati=Math.max(mati, miti[i][j]);
					}
				}
			}
			
			/*↑のfor分の処理は街の数を算出する為の手順*/
			
			mati++;
			
			int num[][]= new int[mati][mati];
			
			for(int i=0; i<mati; i++){
				for(int j=0; j<mati; j++){
					num[i][j] = 100000000;
				}
				num[i][i]=0;
			}
			
			/*↑のfor文の処理は使う部分に0を入れてそれ以外の部分に大きい値を入力する。
			 準備段階*/
			
			for(int i=0; i<mati; i++){
				int a = miti[i][0];
				int b = miti[i][1];
				int c = miti[i][2];
				num[a][b] = c;
				num[b][a] = c;
			}
			
			/*入力したものをそれぞれの変数に格納する
			 準備段階*/
			
			for(int k=0; k<mati; k++){
				for(int i=0; i<mati; i++){
					for(int j=i; j<mati; j++){
						num[i][j] = Math.min(num[i][j], num[i][k]+num[k][j]);
					}
				}
			}
			
			/*↑のfor1文はワーシャルフロイド法まんまコピペ*/
	
			int ans = Integer.MAX_VALUE;
			int ans2 = 0;
			for(int i=0; i<mati; i++){
				int total =0;
				for(int j=0; j<mati; j++){
					total += num[i][j];
				}
				if(total<ans){
					ans = total;
					ans2 = i;
				}
			}
			System.out.println(ans2+" "+ans);

		}
	}
}

Compiler output:
Main.java:3: error: class aoj0189 is public, should be declared in a file named aoj0189.java
public class aoj0189 {
       ^
1 error
Language: C

#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
using namespace std;


int maze[50][50];

int tag[20];

int main()
{
    int n;
    while(~scanf("%d",&n) && n){
        memset(tag,0,sizeof(tag));
        memset(maze,0x3f,sizeof(maze));
        for(int i = 0;i <= 9;++i) maze[i][i] = 0;
        int u,v,l;
        for(int i = 1;i <= n;++i){
            scanf("%d%d%d",&u,&v,&l);
            tag[u] = tag[v] = 1;
            maze[u][v] = maze[v][u] = min(maze[u][v],l);
        }
        
        for(int k = 0;k <= 9;++k){
            for(int i = 0;i <= 9;++i){
                for(int j = 0;j <= 9;++j){
                    maze[j][i] = maze[i][j] = min(maze[i][j],maze[i][k] + maze[k][j]);
                }
            }
        }
        int pos = 0;
        long long ans = 0x3f3f3f3f3f3f;
        for(int i = 0;i <= 9;++i){
            long long tmp = 0;
            for(int j = 0;j <= 9;++j){
                if(!tag[j]) continue;
                tmp += maze[i][j];
            }
            if(ans > tmp){
                ans = tmp;
                pos = i;
            }
            
        }
        cout << pos << ' ' << ans << endl;
    }
    return 0;
}



Compiler output:
main.c:1:10: fatal error: algorithm: No such file or directory
    1 | #include <algorithm>
      |          ^~~~~~~~~~~
compilation terminated.
Language: C

#include<iostream>
using namespace std;

int map[15][15];
int INF=999999;
int main()
{
    int number;
    for(;;)
    {
        cin>>number;
        if(number==0)break;
        for(int i=0;i<=14;i++)
        {
            for(int k=0;k<=14;k++)
            {
                if(i==k)map[i][k]=-1;
                else map[i][k]=INF;
            }
        }
        for(int i=1;i<=number;i++)
        {
            int num1,num2,dis;
            cin>>num1>>num2>>dis;
            map[num1][num2]=map[num2][num1]=dis;
        }

        for(int k=0;k<=15-1;k++)
        {
            for(int i=0;i<=15-1;i++)
            {
                for(int j=0;j<=15-1;j++)
                {
                    if(i!=j&&i!=k&&j!=k)
                    {
                        if(map[i][k]+map[k][j]<map[i][j])map[i][j]=map[i][k]+map[k][j];
                    }
                }
            }
        }
       /* for(int i=0;i<=15-1;i++)
        {
            for(int k=0;k<=15-1;k++)cout<<map[i][k]<<"  ";
            cout<<endl;
        }*/
       int flag=0,sum=INF;
        for(int i=0;i<=15-1;i++)
        {
               int temp=0;
            for(int k=0;k<=15-1;k++)
            {
                if(i!=k&&map[i][k]!=INF)
                temp+=map[i][k];
            }

            if(temp>0&&sum>temp)
            {
             flag=i;
             sum=temp;
            }

        }
      cout<<flag<<" "<<sum<<endl;


    }
}



Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;

int map[15][15];
int x,y;

void init()
{
    for(int i=0; i<15; i++)
    {
        for(int j=0; j<15; j++)
        {
            map[i][j]=99999999;
            if(i==j)
            {
                map[i][j]=0;
            }
        }
    }
}

int main()
{
    int n;
    while(~scanf("%d",&n)&&n)
    {
        int m=0;
        init();
        for(int i=0; i<n; i++)
        {
            scanf("%d%d",&x,&y);
            m=max(m,x);
            m=max(m,y);
            scanf("%d",&map[x][y]);
            map[y][x]=map[x][y];
        }
        m++;
        for(int k=0; k<m; k++)
        {
            for(int i=0; i<m; i++)
            {
                for(int j=0; j<m; j++)
                {
                    if((map[i][k]+map[k][j])<map[i][j])
                    {
                        map[i][j]=map[j][i]=map[i][k]+map[k][j];
                    }
                }
            }
        }
        int ans=99999999;
        int ansi=0;
        for(int i=0; i<m; i++)
        {
            int t=0;
            for(int j=0; j<m; j++)
            {
                t+=map[i][j];
            }
            if(t<ans)
            {
                ansi=i;
                ans=t;
            }
        }
        printf("%d %d\n",ansi,ans);
    }
}



Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include<iostream>
#include<cmath>
#include<set>
using namespace std;

int map[90][90];
int ar[90]={0};
const int INF=99999999;


int main()
{   int n;
    while(cin>>n&&n){
            for(int i=0;i<90;i++){
                    ar[i]=0;
            }
            for(int i=0;i<=2*n;i++){
            for(int j=0;j<=2*n;j++){
                if(i==j){
                    map[i][j]=0;
                }
                else{
                    map[i][j]=INF;
                }
            }
        }

        set<int>myset;
        for(int i=0;i<n;i++){
            int a,b,c;
            cin>>a>>b>>c;
            myset.insert(a);
            myset.insert(b);
            map[a][b]=c;
            map[b][a]=c;
        }
        int num=myset.size();

        for(int k=0;k<num;k++){
            for(int i=0;i<num;i++){
                for(int j=0;j<num;j++){
                    if(i!=j&&i!=k&&j!=k){
                        map[i][j]=min(map[i][j],map[i][k]+map[k][j]);
                    }

                }
            }
        }


        for(int i=0;i<num;i++){
            for(int j=0;j<num;j++){
            ar[i]+=map[i][j];

            }

        }
        int mi=0;int minum=9999999;
        for(int i=0;i<num;i++){

            if(ar[i]<minum){
                mi=i;
                minum=ar[i];
            }
        }
        cout<<mi<<" "<<minum<<endl;

    }

return 0;
}



Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include <iostream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;

typedef struct edge
{
	int s;
	int e;
	int l;
	bool operator<(const edge n)const
	{
		return l<n.l;
	}
} edge;
edge a[50];

int fa[15];
int num[15];
int getFather(int u)
{
	if(fa[u]!=u) fa[u]=getFather(fa[u]);
	return fa[u];
}
void Union(int x,int y)
{
	int fx=getFather(x),fy=getFather(y);
	if(fx!=fy) fa[fx]=fy;
}

int main()
{
	int n,x;
	while(scanf("%d",&n)&&n)
	{
		for(int i=0;i<n;i++)
		{
			scanf("%d%d%d",&a[i].s,&a[i].e,&a[i].l);
		}
		sort(a,a+n);
		memset(num,0,sizeof(num));
		int length=0;
		for(int i=0;i<10;i++) fa[i]=i;
		for(int i=0;i<n;i++)
		{
			if(getFather(a[i].s)!=getFather(a[i].e))
			{
			    Union(a[i].s,a[i].e);
			    length+=a[i].l;
			    num[a[i].s]++;
			    num[a[i].e]++;
	    	}
		}
		int max=0;
		for(int i=0;i<10;i++)
		    if(num[i]>max)
			{
				max=num[i];
				x=i;
	    	}
		cout << x << " " << length << endl;
	}
	
	return 0;
}


Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

//
//  main.cpp
//  7.16练习
//
//  Created by Rain on 2018/7/16.
//  Copyright © 2018年 Rain. All rights reserved.
//
#include<stdio.h>
#include<string.h>
#include<math.h>
//#include<map>
//#include<set>
#include "stdlib.h"
#include "time.h"
#include<deque>
#include<queue>
#include<stack>
#include<string>
#include<iostream>
#include<algorithm>
using namespace std;

#define ll long long
#define inf    0x3f3f3f3f
#define clean(a,b) memset(a,b,sizeof(a))
using namespace std;
int a[105][105];
int vis[105];
int d[105];
int n=0,m;
int t[100];
void Dijkstra(int s)
{
    memset(vis, 0, sizeof vis);
    memset(d, inf, sizeof d);
    d[s]=0;
    for(int i=1;i<=n;i++)
    {
        int minn=inf;
        int u=-1;
        for(int j=1;j<=n;j++)
        {
            if(vis[j]==0&&d[j]<minn)
            {
                minn=d[j];
                u=j;
            }
        }
        if(u==-1)
            return;
        vis[u]=1;
        for(int v=1;v<=n;v++)
        {
            if(vis[v]==0&&d[u]+a[u][v]<d[v])
                d[v]=d[u]+a[u][v];
        }
//        for(int i=1;i<=n;i++)
//        {
//            printf("%d ",d[i]);
//            if(i==n)
//                printf("\n");
//        }
    }
}
int main(int argc, const char * argv[]) {
    int q,w,e;
    while(cin>>m)
    {
        if(m==0)
            break;
        memset(t, 0, sizeof t);
        memset(a, inf, sizeof a);
        for(int i=1;i<=m;i++)
        {
            cin>>q>>w>>e;
            q++;w++;
            t[q]=1;t[w]=1;
            if(a[q][w]>e)
                a[q][w]=a[w][q]=e;
        }
        for(int i=0;i<=11;i++)
        {
            if(t[i])
                n++;
        }
        ll ans=0;
        ll minn=inf;
        int flag=0;
        for(int i=1;i<=n;i++)
        {
            Dijkstra(i);
            for(int j=1;j<=n;j++)
            {
                if(d[j]!=inf)
                    ans+=d[j];
            }
            if(minn>ans)
            {
                minn=ans;
                flag=i;
            }
            
            ans=0;
        }
        printf("%d %lld\n",flag-1,minn);
        n=0;
    }
    return 0;
}



Compiler output:
main.c:15:9: fatal error: deque: No such file or directory
   15 | #include<deque>
      |         ^~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<iostream>
using namespace std;
#define INF 0x3f3f3f

int dis[110][110];
void floyd(int n)
{
    for(int k=0;k<n;k++)
    {
        for(int i=0;i<n;i++)
        {
            for(int j=0;j<n;j++)
            {
                dis[i][j]=min(dis[i][j],(dis[i][k]+dis[k][j]));
            }
        }
    }
}
void into(int n)//初始化
{
    memset(dis,INF,sizeof(dis));
    for(int i=0;i<n;i++)
        dis[i][i]=0;
}
int main()
{
    int n,m;
    int a,b,k;
    while(cin>>n)
    {
        into(12);
        m=0;
        for(int i=0;i<n;i++){
            scanf("%d %d %d",&a,&b,&k);
            dis[a][b]=dis[b][a]=k;
            m=max(max(a,b),m);//位置个数
        }
        floyd(m+1);
        int minn=INF;
        int k=0;
        for(int i=0;i<=m;i++){//最短路
            int ans=0;
            for(int j=0;j<=m;j++){
                ans+=dis[i][j];
            }
            if(ans<minn){
                minn=ans;
                k=i;
            }
            
        }
        printf("%d %d\n",k,minn);
    }
    return 0;
}



Compiler output:
main.c:3:9: fatal error: algorithm: No such file or directory
    3 | #include<algorithm>
      |         ^~~~~~~~~~~
compilation terminated.
Language: C

#include<iostream>
#include<algorithm>
#define inf 0x3f3f3f3f
using namespace std;
int map[50][50];
int n;
int min(int a,int b){
	return a>b?b:a;
}
void floyd(int n){
	int i,j,k;
	for(k=0;k<n;++k){
		for(j=0;j<n;++j){
			for(i=0;i<n;++i){
			map[j][k]=min(map[j][k],map[j][i]+map[i][k]); 
			}
		}
	}
}
int max(int x,int y){
	return x>y?x:y;
}
int main()
{
	
	while(cin>>n&&n){
		for(int i=0;i<n;++i){
			for(int j=0;j<i;++j){
				map[i][j]=map[j][i]=inf;
			}
			map[i][i]=0;
		}
		int m=0;
		for(int i=0;i<n;i++){
			int a,b,c;
			cin>>a>>b>>c;
			map[a][b]=map[b][a]=min(map[a][b],c);
			m=max(max(m,a),b);
		}
		floyd(m+1);
		int res=inf,dian=0;
		for(int i=0;i<=m;++i){
			int p=0;
			for(int j=0;j<=m;++j){
				if(map[i][j]!=inf){
					p+=map[i][j];
				}
			}
			if(p<res){
				res=p;
				dian=i;
			}
		}
		cout<<dian<<" "<<res<<endl;
	}
	return 0;
}


Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
#include<string.h>
#include<iostream>
#include<algorithm>
#include<math.h>
using namespace std;
#define   baba   0x3f3f3f3f
int main()
{
  int n,m;
  while (cin >>m) {
    int l[20];
    int asdf;
    memset(l,0x3f3f3f3f,sizeof(l));
    int a[12][12];
    memset(a,baba,sizeof(a));
    n=0;
    for(int i=0;i<m;i++)
    {
      int x,y;
       cin>>x>>y;
       n=n>x?n>y?n:y:x>y?x:y;
       int z;
       cin>>z;
       if(a[x][y]>z)
        {

        a[x][y]=z;
        a[y][x]=a[x][y];
        }
        //cout<<"  a  "<<n;
    }
    int mx=0x3f3f3f3f;
    for(int i=0;i<=n;i++)
    {
      memset(l,0x3f3f3f3f,sizeof(l));
      int ji[20];///记录该位置的上一个点
      int null=0;
      int mi=i;
      l[i]=0;
      int f[20];
      memset(f,-1,sizeof(f));
      f[mi]=0;
      int f3=0;
      for(int i1=0;i1<n;i1++)
      {
          for(int i2=0;i2<=n;i2++)
          {
            if(f[i2])
            {
              if(l[i2]>a[mi][i2])
              {
                l[i2]=a[mi][i2];
                ji[i2]=mi;
              }
            }
          }
          int f1=0;
          int f2=baba;
          for(int i2=0;i2<=n;i2++)
          {
            if(f[i2])
            {
              if(f2>l[i2]&&l[i2]<0x3f3f3f3f)
              {
                f2=l[i2];
                f1=i2;
              }
            }
          }
          f[f1]=0;
          l[f1]+=l[ji[f1]];
          f3=f2;
          null+=l[f1];
          mi=f1;
        }

      if(mx>null)
      {
      mx=null;
      asdf=i;
      }

    }
    printf("%d %d\n",asdf,mx );

  }
  return 0;
}



Compiler output:
main.c:3:9: fatal error: iostream: No such file or directory
    3 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

//
// Create by Running Photon on 2015-03-27
//

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <algorithm>
#include <cctype>
#include <stack>
#include <queue>
#include <map>
#include <string>
#include <set>
#include <vector>
using namespace std;

#define CLR(x) memset(x,0,sizeof x)
#define ll long long
const int inf=0x3f3f3f3f;
const int maxn=1e5+5;
const int MOD=5e5+5;
int n, m;
int dp[15][15];
int main()
{
#ifdef LOCAL
	freopen("in.txt","r",stdin);
	//freopen("out.txt","w",stdout);
#endif
	ios_base::sync_with_stdio(0);

	while(scanf("%d", &n) != EOF && n){
        m = 0;
        for(int i = 0; i <= 10; i++) for(int j = 0; j <= 10; j++){
            if(i == j) dp[i][j] = 0;
            else dp[i][j] = inf;
        }
        for(int i = 1; i <= n; i++){
            int u, v, val;
            scanf("%d%d%d", &u, &v, &val);
            m = max(m, max(u, v));
            dp[u][v] = dp[v][u] = val;
        }
        int ans = inf, id;
        for(int k = 0; k <= m; k++)for(int i = 0; i <= m; i++) for(int j = 0; j <= m; j++){
            dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j]);
        }
        for(int i = 0; i <= m; i++){
            int sum = 0;
            for(int j = 0; j <= m; j++){
                sum += dp[i][j];
            }
            if(ans > sum){
                ans = sum;
                id = i;
            }
        }
        printf("%d %d\n", id, ans);
	}

	return 0;
}

Compiler output:
main.c:5:10: fatal error: iostream: No such file or directory
    5 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include<bits/stdc++.h>
using namespace std;
int  city[1000][1000],vis[1000],ans[1000];
void dfs(int root,int total)
{
  //  cout<<"root= "<<root<<"total="<<total<<endl;
    vis[root]=1;
    if(ans[root]==0||ans[root]>total)
    {
        ans[root]=total;
    }
    for(int i=0;i<=10;i++)
    if(!vis[i]&&city[root][i])
    {
        vis[i]=1;
        dfs(i,total+city[root][i]);
        vis[i]=0;
    }
}
int main()
{
   int t;
   while(~scanf("%d",&t))
   {
     int a,b,val;
     memset(city,0,sizeof(city));
     memset(ans,0,sizeof(ans));
     memset(vis,0,sizeof(vis));
     if(t==0)
     break;
     for(int i=0;i<t;i++)
     {
         cin>>a>>b>>val;
         city[a][b]=val;
         city[b][a]=val;
     }
//     for(int i=0;i<t;i++)
//     {
//       for(int j=0;j<t;j++)
//       cout<<city[i][j]<<" ";
//       cout<<endl;
//     }

   int total,minV=0,flagI;
     for(int i=0;i<=10;i++)
     {
        total=0;
        memset(ans,0,sizeof(ans));
        memset(vis,0,sizeof(vis));
        dfs(i,0);
        for(int j=0;j<=10;j++)
        if(ans[j]!=0){
            total+=ans[j];
           // cout<<ans[j]<<"out ";
            }
        if((minV==0||minV>total)&&total!=0)
        {
        flagI=i;
        minV=total;
        }
     }
     cout<<flagI<<" "<<minV<<endl;

   }
   return 0;
}

Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>
#include <string.h>
#define INF 0x3f3f3f
int map[15][15], sum;

int min(int a, int b)
{
	return a < b ? a : b;
}
int zdl(int start)
{
	int list[13];
	bool next[13];
	memset(next, false, sizeof(next));
	for(int i=0; i<=sum; i++)
	{
		list[i] = map[start][i];
	}
	next[start] = true;
	int ans = 0, st = INF;
	for(int i=0; i<=sum; i++)
	{
		int k;
		for(int j=0; j<=sum; j++)
		{
			if(!next[j])
			{
				if(st > list[j])
				{
					st = list[j];
					k = j;
				}
			}
		}
		next[k] = true;
		for(int j=0; j<=sum; j++)
		{
			if(st + map[k][j] < list[j])
			{
				list[j] = st + map[k][j];
			}
		}
	}
	for(int i=0; i<=sum; i++)
	{
		ans += list[i];
	}
	return ans;
}
int main()
{
	int n, m, a, b, s;
	while(scanf("%d", &n) != EOF && n)
	{
		sum = 0;
		for(int i=0; i<13; i++)
		{
			for(int j=0; j<13; j++)
			{
				if(i == j)
					map[i][j] = 0;
				else
					map[i][j] = INF;
			}
		}
		for(int i=0; i<n; i++)
		{
			scanf("%d%d%d", &a, &b, &s);
			if(sum < a)	sum = a;
			if(sum < b)	sum = b;
			if(map[a][b] > s)
			{
				map[a][b] = map[b][a] = s;
			}
		}
		int ans = INF, k;
		for(int i=0; i<=sum; i++)
		{
			int ww = zdl(i);
			if(ans > ww)
			{
				ans = ww;
				k = i;
			}
		}
		printf("%d %d\n", k, ans);
	}
	
	return 0;
}

Compiler output:
main.c: In function 'zdl':
main.c:13:9: error: unknown type name 'bool'
   13 |         bool next[13];
      |         ^~~~
main.c:3:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    2 | #include <string.h>
  +++ |+#include <stdbool.h>
    3 | #define INF 0x3f3f3f
main.c:14:22: error: 'false' undeclared (first use in this function)
   14 |         memset(next, false, sizeof(next));
      |                      ^~~~~
main.c:14:22: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:14:22: note: each undeclared identifier is reported only once for each function it appears in
main.c:19:23: error: 'true' undeclared (first use in this function)
   19 |         next[start] = true;
      |                       ^~~~
main.c:19:23: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C

#include<iostream>
#include<cstring>
#include<stdio.h>
#include<math.h>
#include<algorithm>
using namespace std;
const int maxn=10200;
#define oo 1100000
int low[maxn];
int Map[1200][1200];
int v[maxn];
int ans[maxn];
int n;
#define N 111
void init()
{
    for(int i=0; i<=N; i++)
        for(int j=0; j<=N; j++)
        {
            if(i!=j)
                Map[i][j] = oo;
            else
                Map[i][j] = 0;

        }
}
void dij(int x)
{
    memset(v,0,sizeof(v));
    for(int i=0; i<=n; i++)
        low[i] = Map[x][i];
    v[x] = 1;
    for(int i=1; i<=n; i++)
    {
        int Min = oo;
        int index;
        for(int j=1; j<=n; j++)
        {
            if(!v[j]&&low[j]<Min)
            {
                Min = low[j];
                index = j;
            }
        }
        v[index] = 1;
        for(int j=1; j<=n; j++)
            if(!v[j]&&low[j]>Min+Map[index][j])
                low[j] = Min + Map[index][j];
    }
}
int main()
{
    int a,b,c,m;
    while(scanf("%d",&m),m)
    {
        init();
        memset(low,0,sizeof(low));
        n = -1;
        for(int i=1; i<=m; i++)
        {
            scanf("%d%d%d",&a,&b,&c);
            Map[a][b]  = Map[b][a] = min(c,Map[a][b]);
            if(a>n) n = a;
            if(b>n) n = b;
        }
        int k = oo;
        int h;
        memset(ans,0,sizeof(ans));
        for(int i=0; i<=n; i++)
        {
            dij(i);
            for(int j=0; j<=n; j++)
            {
                ans[i] += low[j];
            }
            if(k > ans[i])
            {
                k = ans[i];
                h = i;
            }
        }

        printf("%d %d\n",h,k);
    }
    return 0;
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<algorithm>
#include<stack>
#include<queue>
using namespace std;
#define oo 0x3f3f3f3f
#define maxn 66

int maps[maxn][maxn], vis[maxn], dist[maxn];
int ans;

int dij(int x)
{
    memset(vis, 0, sizeof(vis));
    for(int i=0; i<=ans; i++)
    {
        dist[i]=maps[i][x];
    }

    vis[x]=1;
    int sum=0, t=ans;
    for(int i=1; i<=ans; i++)
    {
        int index;
        int minn=oo;
        for(int j=0; j<=ans; j++)
        {
            if(!vis[j]&&dist[j]<minn)
            {
                minn=dist[j];
                index=j;
            }
        }
        sum+=minn;
        vis[index]=1;
        for(int j=0; j<=ans; j++)
        {
            if(!vis[j]&&dist[j]>minn+maps[index][j])
            {
                dist[j]=minn+maps[index][j];
            }
        }
    }
    return sum;
}

int main()
{
    int n, a, b, c;
    while(scanf("%d", &n), n)
    {
        ans=0;
        for(int i=0; i<maxn; i++)
        {
            for(int j=0; j<maxn; j++)
            {
                maps[i][j]=maps[j][i]=(i==j?0:oo);
            }
        }

        for(int i=0; i<n; i++)
        {
            scanf("%d %d %d", &a, &b, &c);
            maps[a][b]=maps[b][a]=min(maps[a][b], c);
            ans=max(ans, max(a, b));
        }

        int cnt[maxn];
        for(int i=0; i<=ans; i++)
        {
            cnt[i]=dij(i);
        }

        int minn=oo, k;
        for(int i=0; i<=ans; i++)
        {
            if(cnt[i]<minn)
            {
                minn=cnt[i];
                k=i;
            }
        }
        printf("%d %d\n", k,cnt[k]);
    }
    return 0;
}

Compiler output:
main.c:5:9: fatal error: algorithm: No such file or directory
    5 | #include<algorithm>
      |         ^~~~~~~~~~~
compilation terminated.
Language: C

#include<cstdio>
#include<iostream>
#include <algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<cstdlib>
#include<ctime>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<vector>
#define mem(name,value) memset(name,value,sizeof(name))
#define pb push_back
using namespace std;
typedef long long ll;

int N,n,d[12][12],sum[12],ans,MIN;

int main()
{
    while(~scanf("%d",&N),N){
        n=0;
        mem(d,0x3f3f3f3f);
        for(int i=0;i<N;i++){
            int a,b,c;
            scanf("%d%d%d",&a,&b,&c);
            d[a][b]=d[b][a]=c;
            n=a>n?a:n;
            n=b>n?b:n;
        }
        for(int i=0;i<n;i++)
            d[i][i]=0;
        for(int k=0;k<=n;k++)
            for(int i=0;i<=n;i++)
                for(int j=0;j<=n;j++)
                d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
        mem(sum,0);
        MIN=(1<<31)-1;
        for(int i=0;i<=n;i++){
            for(int j=0;j<=n;j++)
                sum[i]+=d[i][j];
            if(sum[i]<MIN){
                MIN=sum[i];
                ans=i;
            }
        }
        cout<<ans<<' '<<MIN<<endl;
    }
}

Compiler output:
main.c:1:9: fatal error: cstdio: No such file or directory
    1 | #include<cstdio>
      |         ^~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
#include<stdlib.h>
#define INF 100000

int m[10][10];

int main(void)
{
	int n,a,b,time,t_num,min,index;
	int i,j,k;

	while (1) {
		scanf("%d", &n);
		if (n == 0)break;
		int sum[10] = { 0 };
		int town[10] = { 0 };
		t_num = 0;
		for (i = 0; i < n; i++) {
			for (j = 0; j < n; j++)
				if (i == j)m[i][j] = 0;
				else
				m[i][j] = INF;
		}

		for (i = 0; i < n; i++) {
			scanf("%d %d %d", &a, &b, &time);
			town[a] = 1,town[b]=1;
			m[a][b] = time;
			m[b][a] = time;
		}

		for (i = 0; i < 10; i++) {
			if (town[i] == 1)t_num++;
		}

		for (i = 0; i < t_num; i++) {
			for (j = 0; j < t_num; j++) 
				for (k = 0; k < t_num; k++) 
					m[j][k] = min(m[j][k], m[j][i] + m[i][k]);
		}
		for (i = 0; i < t_num; i++) {
			for (j = 0; j < t_num; j++)
				sum[i] += m[i][j];
		}
		index = 0;
		min = sum[0];
		for (i = 1; i < t_num; i++) {
			if (min > sum[i]) {
				min = sum[i];
				index = i;
			}
		}
		printf("%d %d\n",index,min);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:39:51: error: called object 'min' is not a function or function pointer
   39 |                                         m[j][k] = min(m[j][k], m[j][i] + m[i][k]);
      |                                                   ^~~
main.c:9:30: note: declared here
    9 |         int n,a,b,time,t_num,min,index;
      |                              ^~~
Language: C

#include <iostream>
#include <algorithm>
#include <cstdio>
#define INF 200000

using namespace std;

const int MAX=11;

int d[MAX][MAX];
int V=11;

int main()
{
    int n;
    while(~scanf("%d", &n) && n)
    {
        for(int i=0; i<V; i++)
        {
            for(int j=0; j<V; j++)
            {
                if(i!=j)
                    d[i][j]=INF;
                else if(i==j)
                    d[i][j]=0;
            }
        }
        for(int i=0; i<n; i++)
        {
            int x,y,m;
            scanf("%d %d %d", &x, &y, &m);
            d[x][y]=m;
            d[y][x]=m;
        }

//        for(int i=0; i<V; i++)
//        {
//            for(int j=0; j<V; j++)
//            {
//                printf("%d ", d[i][j]);
//            }
//            printf("\n");
//        }
//        printf("\n");
        for(int k=0; k<V; k++)
        {
            for(int i=0; i<V; i++)
            {
                for(int j=0; j<V; j++)
                    d[i][j]=min(d[i][j], d[i][k]+d[k][j]);
            }
        }
        int u=0;
        for(int i=0; i<V; i++)
        {
            for(int j=1; j<V; j++)
            {
                if(d[i][j] != INF)
                    d[i][0]+=d[i][j];
            }
            if(d[i][0]<d[u][0])
                u=i;
        }
        printf("%d %d\n", u, d[u][0]);
    }
    return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
#include<algorithm>
#include<math.h>
#include<string.h>
#include<string>
#include<iostream>
#include<stack>
#include<queue>
#include<map>
#define pi 3.1415926
#define INF 0x3f3f3f3f
using namespace std;
int Map[50][50];
int vis[15];
int main()
{
   int n;
   while(~scanf("%d",&n))
   {
       if(n==0)
        break;
        memset(vis,0,sizeof(vis));
       for(int i=0;i<=9;i++)
        for(int j=0;j<=9;j++)
        {
        if(i==j)
        Map[i][j]=0;
        else
        Map[i][j]=INF;
        }
//       for(int i=0;i<=9;i++)
//       {
//        for(int j=0;j<=9;j++)
//        printf("%d ",Map[i][j]);
//       printf("\n");
//
//       }
       for(int i=1;i<=n;i++)
       {
           int u,v,ti;
           scanf("%d%d%d",&u,&v,&ti);
           Map[u][v]=Map[v][u]=ti;
           vis[u]=vis[v]=1;
       }
       for(int k=0;k<=9;k++)
        for(int i=0;i<=9;i++)
        for(int j=0;j<=9;j++)
        {
           if(vis[i]&&vis[j]&&vis[k]&&Map[i][j]>Map[i][k]+Map[k][j])
            Map[i][j]=Map[i][k]+Map[k][j];
        }
       int ans=INF,r;
       for(int i=0;i<=9;i++)
       {
           int t=0;
           if(vis[i])
           for(int j=0;j<=9;j++)
           {
             if(vis[j])
               t+=Map[i][j];
           }
           if(t<ans&&t)
           {
               r=i;
              ans=t;
           }
       }
       printf("%d %d\n",r,ans);
   }
}

Compiler output:
main.c:2:9: fatal error: algorithm: No such file or directory
    2 | #include<algorithm>
      |         ^~~~~~~~~~~
compilation terminated.
Language: C

#include<iostream>
using namespace std;
const int maxn = 20;
const int INF = 0x3f3f3f3f;
int d[maxn][maxn];
int n;
int m;
int res;
int floyd()
{
	int start;
	for(int i = 0; i <= m; i++)
		d[i][i] = 0;
	
	
	for(int k =0; k<=m; k++)
		for(int i = 0; i <= m; i++)
			for(int j = 0; j <= m; j++)
			{
				if(d[i][j] > d[i][k] + d[k][j])
					d[i][j] = d[i][k] + d[k][j];
			}
	
	for(int i = 0; i <= m; i++)
	{
		int cnt = 0;
		for(int j = 0; j <= m; j++)
			cnt += d[i][j];
		if(cnt < res)
		{
			res = cnt;
			start = i;
		}	
	}	
	return start;	
			
}

int main()
{
	//freopen("c:\\users\\administrator\\desktop\\in.txt","r",stdin);
	while(cin >> n,n)
	{
		memset(d,INF,sizeof(d));
		res = INF,m = 0;
		for(int i = 0; i <n; i++)
		{
			int u,v,w;
			cin >> u >> v >>w;
			d[u][v] = w;
			d[v][u] = w;
			m = max(m,max(u,v));
		}
		cout<< floyd()<<" "<<res<<endl;	
			
	}
		
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include<iostream>
#include<cstdio>
#include<cmath>
#include<set>
#include<cstring>
#include<algorithm>
#include<queue>
#include<sstream>
#define N 99999999
using namespace std;
int mp[20][20],vis[20],d[20];
void init()
{
    for(int i=0; i<20; i++)
        for(int j=0; j<20; j++)
            mp[i][j]=N;
    memset(vis,0,sizeof(vis));
    for(int i=0; i<20; i++)
        d[i]=N;

}
int dijk(int s,int n)
{
    int sum=0,i,j;
    memset(vis,0,sizeof(vis));
    for(i=0; i<20; i++)
        d[i]=N;
    d[s]=0;
    while(1)
    {
        int k=-1;
        for(i=0; i<=n; i++)
            if(!vis[i]&&(k==-1||d[i]<d[k]))
                k=i;
        if(k==-1)break;
        vis[k]=1;
        for(j=0; j<=n; j++)
            if(d[j]>d[k]+mp[k][j])
                d[j]=d[k]+mp[k][j];
    }
    for(i=0; i<=n; i++)
        sum+=d[i];
    return sum;
}
int main()
{
    int n;
    while(scanf("%d",&n)&&n)
    {
        init();
        int x,y,w,mx=-1;
        while(n--)
        {
            scanf("%d%d%d",&x,&y,&w);
            mp[x][y]=mp[y][x]=w;
            mx=max(mx,x);
            mx=max(mx,y);
        }
        int mi=N,o,i,t;
        for(i=0; i<=mx; i++)
        {
            t=dijk(i,mx);
            if(mi>t)
            {
                mi=t;
                o=i;
            }
        }
        printf("%d %d\n",o,mi);
    }
    return 0;
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
#include<string.h>
#include<iostream>
#include<algorithm>
#define MAX 6666666
using namespace std;
int map[10][10],p,v[10],V[10];
void floyd(int n);
int main()
{
    int n,x,y,w,i,j,s,max;
    while(cin>>n,n!=0)
    {
        s=0;
        max=-1;
        memset(v,0,sizeof(v));
        memset(V,0,sizeof(V));
        memset(map,0,sizeof(map));
        for(i=0;i<n;i++)
        {
            cin>>x>>y>>w;
            if(map[x][y]<w)
            {
                map[x][y]=w;
                map[y][x]=w;
            }
            if(x>max)
                max=x;
            if(y>max)
                max=y;
        }
        for(i=0;i<=max;i++)
        for(j=0;j<=max;j++)
        {
            if(map[i][j]==0)
                map[i][j]=MAX;
        }
        floyd(max);
        for(i=0;i<=max;i++)
        {
            if(i!=1)
                s+=v[i];
        }
        cout<<p<<" "<<s<<endl;
    }
}
void floyd(int n)
{
    int i,k;
    p=MAX;
    for(i=0;i<=n;i++)
    for(k=0;k<=n;k++)
    {
        p=min(p,map[1][k]);
        if(!V[k])
            v[k]=map[1][k];
        if(map[1][i]+map[i][k]<map[1][k])
        {
            map[1][k]=map[1][i]+map[i][k];
            v[k]=map[i][k];
            V[k]=1;
        }
    }
}

Compiler output:
main.c:3:9: fatal error: iostream: No such file or directory
    3 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
#define INF 1000000
#define rep(i,n) for((i)=0;(i)<=(int)(n);(i)++)
void warshall_floyd(void);
int min(int,int);

int graph[10][10],n;

int main(void){
  int a,b,c,i,j,sum[10],ans1,ans2;

  while(scanf("%d",&n),n){

    for(i=0;i<9;i++)sum[i]=0;
    ans1=INF;

    rep(i,9){
      rep(j,9){
	graph[i][j]=INF;
      }
      graph[i][i]=0;
    }
    
    rep(i,n-1){
      scanf("%d %d %d",&a,&b,&c);
      graph[a][b]=graph[b][a]=c;
    }
    warshall_floyd();

    rep(i,9)
      rep(j,9)
	if(graph[i][j]<INF)sum[i]+=graph[i][j];

    rep(i,9){
      if(ans1>sum[i] && sum[i]>0){
	ans1=sum[i];
	ans2=i;
      }
    }
    printf("%d %d\n",ans2,ans1);
  }

  return 0;
}

void warshall_floyd(void){
  int i,j,k;

  rep(k,9)
    for(i,9)
      for(j,9)
	graph[i][j]=min(graph[i][j],graph[i][k]+graph[k][j]);
}

int min(int x,int y){
  return x<y?x:y;
}

Compiler output:
main.c: In function 'warshall_floyd':
main.c:50:12: error: expected ';' before ')' token
   50 |     for(i,9)
      |            ^
      |            ;
main.c:50:12: error: expected expression before ')' token
main.c:51:14: error: expected ';' before ')' token
   51 |       for(j,9)
      |              ^
      |              ;
main.c:51:14: error: expected expression before ')' token
Language: C++

#include <iostream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <cmath>
#include <queue>
#include <set>

using namespace std;
const int maxn=110;
const int INF=99999999;
int n,m;
int Map[maxn][maxn];
int Min(int x,int y)
{return x<y ? x:y;}

int main()
{
    while(cin>>m&&m!=0)
    {
        for(int i=1;i<maxn;i++)
            for(int j=1;j<maxn;j++)
            if(i==j)Map[i][j]=0;
            else Map[i][j]=INF;
        n=0;
        for(int i=0;i<m;i++)
        {
            int a,b,c;
            scanf("%d%d%d",&a,&b,&c);
            if(a+1>n)n=a+1;
            if(b+1>n)n=b+1;
            Map[a+1][b+1]=Map[b+1][a+1]=c;
        }

        for(int k=1;k<=n;k++)
            for(int i=1;i<=n;i++)
            for(int j=1;j<=n;j++)
                if(i!=j&&j!=k&&k!=i)
            Map[i][j]=Min(Map[i][j],Map[i][k]+Map[k][j]);
        int mm=INT_MAX;
        int ans;
        for(int i=1;i<=n;i++)
        {
            int step=0;
            for(int j=1;j<=n;j++)
                step+=Map[i][j];
            if(step<mm)
            {
                mm=step;
                ans=i;
            }
        }
        cout<<ans-1<<' '<<mm<<endl;
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:40:16: error: 'INT_MAX' was not declared in this scope
   40 |         int mm=INT_MAX;
      |                ^~~~~~~
a.cc:8:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    7 | #include <set>
  +++ |+#include <climits>
    8 |
Language: C++

#include<algorithm>
#include<stdio.h>
#define INF 0x3f3f3f3f
typedef long long ll;
using namespace std;
 
#define  N 15
int n;
int dis[N],maps[N][N];
int main()
{
    int i,a,b,c,j,k;
    while(scanf("%d",&n),n)
    {
        for(i=0;i<N;i++)
        {
            for(j=0;j<N;j++)
            {
                maps[i][j]=(i==j)?0:INF;
            }
        }
 
        int m=-1;
        for( i=0; i<n; i++)
        {
            scanf("%d%d%d",&a,&b,&c);
            m=max(a,m);
            m=max(b,m);
            maps[a][b]=maps[b][a]=c;
        }
 
        for(k=0;k<=m;k++)
        {
            for(i=0;i<=m;i++)
            {
                for(j=0;j<=m;j++)
                {
                    if(maps[i][j]>maps[i][k]+maps[k][j])
                        maps[i][j]=maps[i][k]+maps[k][j];
                }
            }
        }
 
        int  Min=INF;
        int index=-1;
        memset(dis,0,sizeof(dis));
        for(i=0;i<=m;i++)
        {
            for(j=0;j<=m;j++)
            {
                dis[i]=dis[i]+maps[i][j];
            }
            if(Min>dis[i])
            {
                index=i;
                Min=dis[i];
            }
        }
        printf("%d %d\n",index,Min);
    }
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:46:9: error: 'memset' was not declared in this scope
   46 |         memset(dis,0,sizeof(dis));
      |         ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<stdio.h>
  +++ |+#include <cstring>
    3 | #define INF 0x3f3f3f3f
Language: C++

#include <algorithm>
#include <cstdio>
#include <limits>
#include <queue>
#include <vector>
using namespace std;

int d[10][10];

int main() {
	for (;;) {
		int n; scanf("%d", &n);
		if (n == 0) break;
		for (int u = 0; u < 10; u++)
			for (int v = 0; v < 10; v++)
				d[u][v] = (u == v) ? 0 : (INT_MAX / 2);
		int N = 0;
		for (; n > 0; n--) {
			int a, b, c;
			scanf("%d%d%d", &a, &b, &c);
			d[a][b] = c;
			d[b][a] = c;
			N = max(N, max(a + 1, b + 1));
		}
		for (int k = 0; k < N; k++)
			for (int u = 0; u < N; u++)
				for (int v = 0; v < N; v++)
					d[u][v] = min(d[u][v], d[u][k] + d[k][v]);
		int umin = 0, dmin = INT_MAX;
		for (int u = 0; u < N; u++) {
			int dsum = 0;
			for (int v = 0; v < N; v++)
				dsum += d[u][v];
			if (dsum < dmin) {
				umin = u;
				dmin = dsum;
			}
		}
		printf("%d %d\n", umin, dmin);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:59: error: 'INT_MAX' was not declared in this scope
   16 |                                 d[u][v] = (u == v) ? 0 : (INT_MAX / 2);
      |                                                           ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <queue>
  +++ |+#include <climits>
    5 | #include <vector>
a.cc:29:38: error: 'INT_MAX' was not declared in this scope
   29 |                 int umin = 0, dmin = INT_MAX;
      |                                      ^~~~~~~
a.cc:29:38: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#define _CRT_SECURE_NO_WARNINGS

#include<fstream>
#include<iostream>
#include<string>
#include<iomanip>
#include<list>
#include<math.h>
#include<stack>
#include<queue>
#include<vector>
#include<algorithm>
#include<utility>

using namespace std;

typedef struct edge {
	int from;
	int to;
	int time;
} edge;


int main(){
	int n;


	while (cin >> n && n != 0) {
		int min_ = INT_MAX;
		int min_num = 1;
		vector<edge> town;
		int cost[50][50];
		int max_ = 0;

		for (int i = 0; i < 50; i++) {
			for (int j = 0; j < 50; j++) {
				cost[i][j] = INT_MAX / 10;
			}
		}
		for (int i = 0; i < 50; i++) {
			cost[i][i] = 0;
		}
		for (int i = 0; i < n; i++) {
			edge tmp;
			cin >> tmp.from >> tmp.to >> tmp.time;
			cost[tmp.from][tmp.to] = tmp.time;
			cost[tmp.to][tmp.from] = tmp.time;
			max_ = max(max(tmp.from, tmp.to), max_);
		}
		max_++;
		for (int i = 0; i < max_; i++) {
			for (int j = 0; j < max_; j++) {
				for (int k = 0; k < max_; k++) {
					cost[i][j] = min(cost[i][j], cost[i][k] + cost[k][j]);
				}
			}
		}
		for (int i = 0; i < max_; i++) {
			int total = 0;
			for (int j = 0; j < max_; j++) {
				total += cost[i][j];
			}
			if (total < min_) {
				min_ = total;
				min_num = i;
			}
		}
		cout << min_num << " " << min_ << endl;
  }
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:28: error: 'INT_MAX' was not declared in this scope
   29 |                 int min_ = INT_MAX;
      |                            ^~~~~~~
a.cc:14:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   13 | #include<utility>
  +++ |+#include <climits>
   14 |