criyle/codenet-compile-errors huggingface dataset:
Language: C++


#include <memory>
#include <memory.h>
using namespace std;

bool tree[1000][1000];
int s[1000][1000];

int main(){
  int n, w, h;
  int x, y, S, T;
  while(cin >> n && n){
    memset(s, 0, sizeof(s));
    memset(tree, false, sizeof(tree));
    cin >> w >> h;
    for(int i = 0; i < n; i++){
      cin >> x >> y;
      tree[x][y] = true;
    }
    cin >> S >> T; 
    for(int i = 1; i <= w; i++){
      for(int j = 1; j <= h; j++){
	s[i][j] = s[i-1][j] + s[i][j-1] - s[i-1][j-1];
	if(tree[i][j]) s[i][j]++;
      }
    }
    int res = 0;
    for(int i = 1; i <= w - S + 1; i++){
      for(int j = 1; j <= h - T + 1; j++){
	int num = s[i+S-1][j+T-1] - s[i][j+T-1] - s[j+S-1][j] + s[i][j];
	res = max(num, res);
      }
    }
    cout << res << endl;
  }
  return 0;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'cin' was not declared in this scope
   12 |   while(cin >> n && n){
      |         ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include <memory.h>
  +++ |+#include <iostream>
    4 | using namespace std;
a.cc:34:5: error: 'cout' was not declared in this scope
   34 |     cout << res << endl;
      |     ^~~~
a.cc:34:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:34:20: error: 'endl' was not declared in this scope
   34 |     cout << res << endl;
      |                    ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include <memory.h>
  +++ |+#include <ostream>
    4 | using namespace std;
Language: C++

#include<iostream>
using namespace std;

int main(){
	int N=0,W=0,H=0,S=0,T=0;
	int tree_exist[100][100]={0};

	while(cin >> N,N){

		cin >> W >> H;

		memset(tree_exist,0,sizeof(tree_exist));
		int x,y;
		for(int i=0;i<N;i++){
			cin >> x >> y;
			tree_exist[y][x] = 1;
		}

		cin >> S >> T;
		int max=0;
		for(int y=1;y<=H;y++){ // ðÚ®³¹é
			for(int x=1;x<=W;x++){

				int cnt=0;
				for(int y2=0;y2<T;y2++){ // ÌÌØÌ{ð²×é
					if(y+y2 > H) break;
					for(int x2=0;x2<S;x2++){
						if(x+x2 > W) break;

						cnt += tree_exist[y+y2][x+x2];
						if(cnt>max) max = cnt;
					}
				}
			}
		}

		cout << max << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: 'memset' was not declared in this scope
   12 |                 memset(tree_exist,0,sizeof(tree_exist));
      |                 ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

#include<iostream>
using namespace std;

int main(){
	int N=0,W=0,H=0,S=0,T=0;
	int tree_exist[100][100]={0};

	while(cin >> N&&N!=0){

		cin >> W >> H;

		memset(tree_exist,0,sizeof(tree_exist));
		int x,y;
		for(int i=0;i<N;i++){
			cin >> x >> y;
			tree_exist[y][x] = 1;
		}

		cin >> S >> T;
		int max=0;
		for(int y=1;y<=H;y++){ // ðÚ®³¹é
			for(int x=1;x<=W;x++){

				int cnt=0;
				for(int y2=0;y2<T;y2++){ // ÌÌØÌ{ð²×é
					if(y+y2 > H) break;
					for(int x2=0;x2<S;x2++){
						if(x+x2 > W) break;

						cnt += tree_exist[y+y2][x+x2];
						if(cnt>max) max = cnt;
					}
				}
			}
		}

		cout << max << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: 'memset' was not declared in this scope
   12 |                 memset(tree_exist,0,sizeof(tree_exist));
      |                 ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

#include<iostream>
using namespace std;

int main(){
	int N=0,W=0,H=0,S=0,T=0;
	int tree_exist[100][100]={0};

	while(1){
		cin >> N;
		if(N==0) break;

		cin >> W >> H;

		memset(tree_exist,0,sizeof(tree_exist));
		int x,y;
		for(int i=0;i<N;i++){
			cin >> x >> y;
			tree_exist[y][x] = 1;
		}

		cin >> S >> T;
		int max=0;
		for(int y=1;y<=H;y++){ // ðÚ®³¹é
			for(int x=1;x<=W;x++){

				int cnt=0;
				for(int y2=0;y2<T;y2++){ // ÌÌØÌ{ð²×é
					if(y+y2 > H) break;
					for(int x2=0;x2<S;x2++){
						if(x+x2 > W) break;

						cnt += tree_exist[y+y2][x+x2];
						if(cnt>max) max = cnt;
					}
				}
			}
		}

		cout << max << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'memset' was not declared in this scope
   14 |                 memset(tree_exist,0,sizeof(tree_exist));
      |                 ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

#include <iostream>

using namespace std;

#define N_MAX 1000;

int main(void)
{

	int n;
	int w,h;

	int x,y;

	int s,t;

	cin >> n;
	cin >> w;
	cin >> h;

	int f[N_MAX][N_MAX];

	int count;
	int max;

	int i1,i2,i3,i4;


	/* syoki*/
	for (i1=0;i1<h;i1++){
		for (i2=0;i2<w;i2++){
			f[i1][i2]=0;
		}
	}

	/* tree */
	for (i1=0;i1<n;i1++){
		cin >> x;
		cin >> y;

		f[y-1][x-1] = 1;

		cout << endl;

		for (i3=0;i3<h;i3++){
			for (i2=0;i2<w;i2++){

				cout << f[i3][i2] << " ";
			}
			cout << endl;
		}
	


	}

	cin >> s; 
	cin >> t;

	max = 0;
	
	for(i1=0;i1<=h-t;i1++){
		for(i2=0;i2<=w-s;i2++){


			count = 0;
			for(i3=i1;i3<t+i1;i3++){
				for(i4=i2;i4<s+i2;i4++){
					if (f[i3][i4]==1){
						count++;
					}
				}
			}
			
			//cout << count << " ";

			if (max < count){
				max = count;
			}
		}
	}

	//cout << endl;
	/* print */
	
/*	for (i1=0;i1<h;i1++){
		for (i2=0;i2<w;i2++){

			cout << f[i1][i2] << " ";
		}
		cout << endl;
	}
*/	

	cout << max << endl;


	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:19: error: expected ']' before ';' token
    5 | #define N_MAX 1000;
      |                   ^
a.cc:21:15: note: in expansion of macro 'N_MAX'
   21 |         int f[N_MAX][N_MAX];
      |               ^~~~~
a.cc:21:20: error: expected primary-expression before ']' token
   21 |         int f[N_MAX][N_MAX];
      |                    ^
a.cc:21:27: error: expected primary-expression before ']' token
   21 |         int f[N_MAX][N_MAX];
      |                           ^
a.cc:32:25: error: 'f' was not declared in this scope
   32 |                         f[i1][i2]=0;
      |                         ^
a.cc:41:17: error: 'f' was not declared in this scope
   41 |                 f[y-1][x-1] = 1;
      |                 ^
a.cc:69:45: error: 'f' was not declared in this scope
   69 |                                         if (f[i3][i4]==1){
      |                                             ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cstdio>
#include <map>

#define rep(i, n) for(int i = 0; i < n; i++)
#define FOR(i, a, b) for(int i = a; i < b; i++)
#define all(v) (v).begin(), (v).end()

using namespace std;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> P;

void p(vi v){
	rep(i, v.size()){
		cout << v[i] << ' ';
	}
	cout << endl;
}

int field[200][200];

int main(){
	int n;
	while(cin >> n, n){
		memset(field, 0, sizeof(field));
		int w, h;
		cin >> w >> h;
		vector<P> p(n);
		rep(i, n){
			int x, y;
			cin >> x >> y;
			p[i] = P(x, y);
		}
		int s, t;
		cin >> s >> t;
		rep(i, n){
			int x, y;
			x = p[i].first;
			y = p[i].second;
			rep(j, s){
				rep(k, t){
					field[100+y-k][100+x-j]++;
				}
			}
		}

		int maxim = 0;
		rep(j, 100-s){
			rep(k, 100-t){
				maxim = max(maxim, field[100+k][100+j]);
			}
		}

		cout << maxim << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:17: error: 'memset' was not declared in this scope
   30 |                 memset(field, 0, sizeof(field));
      |                 ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include <map>
  +++ |+#include <cstring>
    7 |
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(){
	int N;
	while( cin >> N, N ){
		int i, j, k, l;
		int W, H, S, T;
		cin >> W >> H;
		char field[100][100];
		memset(field, '.', sizeof(field));
		for( i = 0; i < N; i++ ){
			int X, Y;
			cin >> X >> Y;
			field[X][Y] = '*';
		}
		cin >> S >> T;
		int max = 0;
		for( i = 0; i < W; i++ ){
			for( j = 0; j < H; j++ ){
				int sum = 0;
				for( k = 0; k < S; k++ ){
					for( l = 0; l < T; l++ ){
						if( field[i+k][j+l] == '*' ){
							sum++;
						}
					}
				}
				if( max < sum ){ max = sum; }
			}
		}
		cout << max << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'memset' was not declared in this scope
   11 |                 memset(field, '.', sizeof(field));
      |                 ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <vector>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
	int N;
	while( cin >> N, N ){
		int i, j, k, l;
		int W, H, S, T;
		cin >> W >> H;
		char field[100][100];
		memset(field, '.', sizeof(field));
		for( i = 0; i < N; i++ ){
			int X, Y;
			cin >> X >> Y;
			field[X][Y] = '*';
		}
		cin >> S >> T;
		int max = 0;
		for( i = 0; i < W; i++ ){
			for( j = 0; j < H; j++ ){
				int sum = 0;
				for( k = 0; k < S; k++ ){
					for( l = 0; l < T; l++ ){
						if( field[i+k][j+l] == '*' ){
							sum++;
						}
					}
				}
				if( max < sum ){ max = sum; }
			}
		}
		cout << max << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'memset' was not declared in this scope
   11 |                 memset(field, '.', sizeof(field));
      |                 ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: Java

import java.util.Scanner;


public class TheSecretNumberDP {
	int m, n;
	char[][] map;
	Scanner in = new Scanner(System.in);
	
	String remove_zero(String s) {
		int k;
		for (k = 0; k < s.length(); k++) {
			if (s.charAt(k) != '0') break;
		}
		return s.substring(k, s.length()); 
	}
	
	boolean compare(String s1, String s2) {
		if (s1.length() > s2.length()) return true;
		else if (s1.length() < s2.length()) return false;
		else {
			for (int i = 0; i < s1.length(); i++) {
				if (s1.charAt(i) > s2.charAt(i)) return true;
				else if (s1.charAt(i) < s2.charAt(i)) return false;
			}
		}
		return true;
	}
	
	public TheSecretNumberDP() {
		while (true) {
			int m = in.nextInt();
			int n = in.nextInt();
			if (m == 0 && n == 0) break;
			map = new char[n+1][m+1];
			for (int i = 1; i <= n; i++) {
				String s = in.next();
				for (int j = 0; j < m; j++) {
					map[i][j+1] = s.charAt(j);
				}
			}
			String[][] dp = new String[n+1][m+1];
			for (int i = 0; i <= n; i++) 
				for (int j = 0; j <= m; j++) 
					dp[i][j] = "";
			
			String ans = "";		
			for (int i = 1; i <= n; i++) {
				for (int j = 1; j <= m; j++) {
					if (map[i][j] >= 'A' && map[i][j] <= 'Z' || map[i][j] == 0)
						continue;
					else if (map[i][j] == '0' && dp[i][j-1] == "" && dp[i-1][j] == "") 
						continue;
					else {
						dp[i][j] = (compare(dp[i][j-1] + map[i][j], dp[i][j])) ? dp[i][j-1] + map[i][j] : dp[i][j];
						dp[i][j] = (compare(dp[i-1][j] + map[i][j], dp[i][j])) ? dp[i-1][j] + map[i][j] : dp[i][j];
					}
					ans = compare(dp[i][j], ans) ? dp[i][j] : ans;
				}
			}
			System.out.println(ans);
		}
	}
	
	public static void main(String[] args) {
		new TheSecretNumberDP();
	}
}

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

// Aizu 1126: The Secret Number
// 2017.9.15 bal4u@uu

#include <stdio.h>
#include <ctype.h>
#include < string.h>

char d[72][72], s[72][72][72];
int a[72][72];
char ans[72]; int len;

int main()
{
	int w, h, r, c;

	while (scanf("%d%d", &w, &h) && w) {;
		memset(a, 0, sizeof(a));
		for (r = 0; r < h; r++) scanf("%s", d[r]);
		for (r = 0; r < h; r++) for (c = 0; c < w; c++) {
			if (!isdigit(d[r][c])) continue;
			a[r][c] = 0;
			if (c > 0 && isdigit(d[r][c-1]))
				a[r][c] = a[r][c-1], memcpy(s[r][c], s[r][c-1], a[r][c]);
			if (r > 0 && isdigit(d[r-1][c])) {
				if (a[r-1][c] > a[r][c] || (a[r-1][c] == a[r][c] && memcmp(s[r-1][c], s[r][c], a[r][c]) > 0))
					a[r][c] = a[r-1][c], memcpy(s[r][c], s[r-1][c], a[r][c]);
			}
			if (a[r][c] == 0 && d[r][c] == '0') continue;
			s[r][c][a[r][c]] = d[r][c], a[r][c]++;
		}
		for (len = 0, r = 0; r < h; r++) for (c = 0; c < w; c++) {
			if (a[r][c] > len || (a[r][c] == len && memcmp(s[r][c], ans, len) > 0)) len = a[r][c], memcpy(ans, s[r][c], len);
		}
		ans[len] = 0;
		puts(ans);
    }
	return 0;
}

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

#include <stdio.h>
#include <string.h>
#include <ctype.h>
#define MAX(a,b) ((a) > (b) ? (a) : (b));

main(){
	int W,H;
	while(1){
		scanf("%d%d",&W,&H);
		if(W+H==0) break;
		int ward,m[70][70];
		int maxcode;
		for(i=0;i<H;i++){
			for(j=0;j<W;j++){
				ward=getchar();
				if(isdigit(ward)){
					if(i+j==0) m[i][j]=ward; //0行0列目ならば．
					else if(i>0&&j==0){
						if(isdigit(m[i-1][j])) m[i][j]=ward+m[i-1][j]*10;
						else m[i][j]=ward;
					}else if(j>0&&i==0){
						if(isdigit(m[i][j-1])) m[i][j]=ward+m[i][j-1]*10;
						else m[i][j]=ward;
					}else{
						int up=0,right=0;
						if(isdigit(m[i-1][j])) up=m[i-1][j];
						if(isdigit(m[i][j-1])) right=[i-1][j];
						m[i][j]=ward+MAX(up,right)*10;
					}
				}else m[i][j]=ward;
				maxcode=MAX(maxcode,m[i][j]);
			}
		}
		printf("%d",maxcode);
	}
}

Compiler output:
main.c:6:1: error: return type defaults to 'int' [-Wimplicit-int]
    6 | main(){
      | ^~~~
main.c: In function 'main':
main.c:13:21: error: 'i' undeclared (first use in this function)
   13 |                 for(i=0;i<H;i++){
      |                     ^
main.c:13:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:29: error: 'j' undeclared (first use in this function)
   14 |                         for(j=0;j<W;j++){
      |                             ^
main.c:27:78: error: expected expression before '[' token
   27 |                                                 if(isdigit(m[i][j-1])) right=[i-1][j];
      |                                                                              ^
main.c:28:75: error: invalid type argument of unary '*' (have 'int')
   28 |                                                 m[i][j]=ward+MAX(up,right)*10;
      |                                                                           ^~~
Language: C++

#include <iostream>
#include <vector>
#include <cstring>
#include <string>
#include <algorithm>
#include <iomanip>
using namespace std;

string b[70];
string memo[70][70];

bool comp(string& s1, string& s2) {
	if(s1.size() == s2.size()) return s1 < s2;
	return s1.size() < s2.size();
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int W, H;
	while(cin >> W >> H, W | H) {
		for(int i = 0; i < H; i++) {
			cin >> b[i];
		}
		for(int i = 0; i < H; i++) {
			for(int j = 0; j < W; j++) {
				memo[i][j] = "";
				if('1' <= b[i][j] && b[i][j] <= '9') memo[i][j] += b[i][j];
			}
		}

		for(int i = 0; i < H; i++) {
			for(int j = 0; j < W; j++) {
				if('0' <= b[i][j] && b[i][j] <= '9') {
					if(i + 1 < H) {
						if('0' <= b[i + 1][j] && b[i + 1][j] <= '9') {
							if(comp(memo[i + 1][j], memo[i][j] + b[i + 1][j]))
								memo[i + 1][j] = memo[i][j] + b[i + 1][j];
						}
					}
					if(j + 1 < W) {
						if('0' <= b[i][j + 1] && b[i][j + 1] <= '9') {
							if(comp(memo[i][j + 1], memo[i][j] + b[i][j + 1]))
								memo[i][j + 1] = memo[i][j] + b[i][j + 1];
						}
					}
				}
			}
		}

		string ans = "0";
		for(int i = 0; i < H; i++) {
			for(int j = 0; j < W; j++) {
				if(comp(ans, memo[i][j])) ans = memo[i][j];
			}
		}

		cout << ans << endl;
	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:92: error: cannot bind non-const lvalue reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} to an rvalue of type 'std::__cxx11::basic_string<char>'
   38 |                                                         if(comp(memo[i + 1][j], memo[i][j] + b[i + 1][j]))
a.cc:12:31: note:   initializing argument 2 of 'bool comp(std::string&, std::string&)'
   12 | bool comp(string& s1, string& s2) {
      |                       ~~~~~~~~^~
a.cc:44:92: error: cannot bind non-const lvalue reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} to an rvalue of type 'std::__cxx11::basic_string<char>'
   44 |                                                         if(comp(memo[i][j + 1], memo[i][j] + b[i][j + 1]))
a.cc:12:31: note:   initializing argument 2 of 'bool comp(std::string&, std::string&)'
   12 | bool comp(string& s1, string& s2) {
      |                       ~~~~~~~~^~
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define LOG(...) fprintf(stderr, __VA_ARGS__)
// #define LOG(...)
#define FOR(i, a, b) for(int i = (int)(a); i < (int)(b); ++i)
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define RREP(i, n) for(int i = (int)(n - 1); i >= 0; --i)
#define RFOR(i, a, b) for(int i = (int)(b - 1); i >= (int)(a); --i)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define SQ(n) (n) * (n)
#define BIT(x, i) (((x) >> (i)) & 1)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<pii> vpi;
typedef vector<pll> vpl;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vc> vvc;
typedef vector<vll> vvll;

char field[70][70];
string dp[70][70];

string strmax(string a, string b) {
  if (a.length() > b.length()) return a;
  if (a.length() < b.length()) return b;
  return max(a, b);
}

int dx[] = {-1, 0};
int dy[] = {0, -1};

int main() {
  int w, h;
  while(cin >> w >> h, w) {
    fill_n((char*)field, 70 * 70, ' ');
    fill_n((string*)dp, 70 * 70, "");
    REP(y, h) REP(x, w) {
      cin >> field[y][x];
    }
    dp[h - 1][w - 1] = field[h - 1][w - 1];

    string maxs = "";
    RREP(y, h) RREP(x, w) {
      REP(i, 2){
        int sx = x + dx[i];
        int sy = y + dy[i];
        if (sx < 0 || sx >= w || sy < 0 || sy >= h) continue;
        if (isnumber(field[y][x]) && isnumber(field[sy][sx])) {
          dp[sy][sx] = strmax(dp[sy][sx], field[sy][sx] + dp[y][x]);
          // maxs = strmax(maxs, dp[sy][sx]);
        }
      }
    }

    REP(y, h) REP(x, w) {
      while(*dp[y][x].begin() == '0') dp[y][x].erase(dp[y][x].begin());
      maxs = strmax(maxs, dp[y][x]);
    }
    cout << maxs << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:62:13: error: 'isnumber' was not declared in this scope
   62 |         if (isnumber(field[y][x]) && isnumber(field[sy][sx])) {
      |             ^~~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define LOG(...) fprintf(stderr, __VA_ARGS__)
// #define LOG(...)
#define FOR(i, a, b) for(int i = (int)(a); i < (int)(b); ++i)
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define RREP(i, n) for(int i = (int)(n - 1); i >= 0; --i)
#define RFOR(i, a, b) for(int i = (int)(b - 1); i >= (int)(a); --i)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define SQ(n) (n) * (n)
#define BIT(x, i) (((x) >> (i)) & 1)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<pii> vpi;
typedef vector<pll> vpl;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vc> vvc;
typedef vector<vll> vvll;

char field[70][70];
string dp[70][70];

string strmax(string a, string b) {
  if (a.length() > b.length()) return a;
  if (a.length() < b.length()) return b;
  return max(a, b);
}

int dx[] = {-1, 0};
int dy[] = {0, -1};

int main() {
  int w, h;
  while(cin >> w >> h, w) {
    fill_n((char*)field, 70 * 70, ' ');
    fill_n((string*)dp, 70 * 70, "");
    REP(y, h) REP(x, w) {
      cin >> field[y][x];
    }
    dp[h - 1][w - 1] = field[h - 1][w - 1];

    string maxs = "";
    RREP(y, h) RREP(x, w) {
      REP(i, 2){
        int sx = x + dx[i];
        int sy = y + dy[i];
        if (sx < 0 || sx >= w || sy < 0 || sy >= h) continue;
        if (isdigit(field[y][x]) && isnumber(field[sy][sx])) {
          dp[sy][sx] = strmax(dp[sy][sx], field[sy][sx] + dp[y][x]);
          // maxs = strmax(maxs, dp[sy][sx]);
        }
      }
    }

    REP(y, h) REP(x, w) {
      while(*dp[y][x].begin() == '0') dp[y][x].erase(dp[y][x].begin());
      maxs = strmax(maxs, dp[y][x]);
    }
    cout << maxs << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:62:37: error: 'isnumber' was not declared in this scope
   62 |         if (isdigit(field[y][x]) && isnumber(field[sy][sx])) {
      |                                     ^~~~~~~~
Language: C++

#include <vector>
int main(){
vector<int> a(1000000000);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:1: error: 'vector' was not declared in this scope
    3 | vector<int> a(1000000000);
      | ^~~~~~
a.cc:3:1: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:3:8: error: expected primary-expression before 'int'
    3 | vector<int> a(1000000000);
      |        ^~~
Language: C++

#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
typedef pair<int, int>P;

char c[80][80];
struct str {
	string s;
	str(string s = "") :s(s) {}
}d[80][80];
bool operator<(str a, str b) {
	if (a.s.size() == b.s.size())return a.s < b.s;
	return a.s.size() < b.s.size();
}
int main() {
	int w, h;
	while (scanf("%d%d", &w, &h), w) {
		rep(i, h)scanf("%s", c[i]);
		str Max = "0";
		rep(i, h)rep(j, w) {
			if ('0' <= c[i][j] && c[i][j] <= '9') {
				d[i][j] = to_string(c[i][j] - '0');
				if (i)d[i][j] = max(d[i][j], str(d[i - 1][j].s + c[i][j]));
				if (j)d[i][j] = max(d[i][j], str(d[i][j - 1].s + c[i][j]));
				str s = d[i][j];
				while (!s.s.empty() && s.s.front() == '0')s = s.s.substr(1);
				Max = max(Max, s);
			}
			else d[i][j] = (string)"";
		}
		cout << Max.s << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:27: error: conversion from 'const char [2]' to non-scalar type 'str' requested
   19 |                 str Max = "0";
      |                           ^~~
Language: C++

#include "bits/stdc++.h"
using namespace std;
#define ll long long
#define INF (1<<30)
#define LINF (1LL<<60)

//http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1126

#define MAXH 75
#define MAXW 75
vector<vector<string>> dp(MAXH, vector<string>(MAXW));
vector<vector<int>> f(MAXH, vector<int>(MAXW));
string ans;
int W, H;

inline bool str_check(string& a, string&b) {
	if (a.size() > b.size()) return true;
	else if (a.size() < b.size()) return false;
	else {
		int Size = a.size();
		for (int i = 0; i < Size;i++) {
			if (a[i] != b[i]) return a[i] > b[i] ? true : false;
		}
	}
	return false;
}

void dfs(int h, int w, vector<vector<char>>& C) {
	f[h][w] = 1;

	bool dfs_f = false;

	if (f[h][w - 1] == 0 && C[h][w - 1] < 'A') {
		if (dp[h][w - 1] == "-") {
			dp[h][w - 1] = C[h][w - 1] + dp[h][w];
			dfs(h, w - 1, C);

			dfs_f = true;
		}
		else {
			if (str_check(C[h][w - 1] + dp[h][w], dp[h][w - 1])) {
				dp[h][w - 1] = C[h][w - 1] + dp[h][w];
				dfs(h, w - 1, C);

				dfs_f = true;
			}
		}
	}

	if (f[h - 1][w] == 0 && C[h - 1][w] < 'A') {
		if (dp[h - 1][w] == "-") {
			dp[h - 1][w] = C[h - 1][w] + dp[h][w];
			dfs(h - 1, w, C);

			dfs_f = true;
		}
		else {
			if (str_check(C[h - 1][w] + dp[h][w], dp[h - 1][w])) {
				dp[h - 1][w] = C[h - 1][w] + dp[h][w];
				dfs(h - 1, w, C);

				dfs_f = true;
			}
		}
	}

	if (!dfs_f) {
		if (str_check(dp[h][w], ans)) {
			ans = dp[h][w];
		}
	}
}

int main() {
	cin.tie(0); ios::sync_with_stdio(false);
	while (cin >> W >> H) {
		if (W == 0 && H == 0) break;
		ans = "0";
		for (int i = 0; i < MAXH; i++) for (int j = 0; j < MAXW;j++) {
			dp[i][j] = "-";
			f[i][j] = 0;
		}
		vector<vector<char>> C(H + 2, vector<char>(W + 2, 'A'));
		for (int i = 1; i <= H;i++) for (int j = 1; j <= W;j++) cin >> C[i][j];

		for (int i = H; i > 0; i--) {
			for (int j = W; j > 0;j--) {
				if (f[i][j] == 0 && C[i][j] < 'A') {
					dp[i][j] = C[i][j];
					dfs(i, j, C);
				}
			}
		}

		bool zefo_flag = true;
		for (int i = 0; i < ans.length();i++) {
			if (ans[i] == '0' && zefo_flag == true) continue;
			if (ans[i] != '0') zefo_flag = false;
			cout << ans[i];
		}
		cout << endl;
	}
}

Compiler output:
a.cc: In function 'void dfs(int, int, std::vector<std::vector<char> >&)':
a.cc:41:51: error: cannot bind non-const lvalue reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} to an rvalue of type 'std::__cxx11::basic_string<char>'
   41 |                         if (str_check(C[h][w - 1] + dp[h][w], dp[h][w - 1])) {
a.cc:16:31: note:   initializing argument 1 of 'bool str_check(std::string&, std::string&)'
   16 | inline bool str_check(string& a, string&b) {
      |                       ~~~~~~~~^
a.cc:58:51: error: cannot bind non-const lvalue reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} to an rvalue of type 'std::__cxx11::basic_string<char>'
   58 |                         if (str_check(C[h - 1][w] + dp[h][w], dp[h - 1][w])) {
a.cc:16:31: note:   initializing argument 1 of 'bool str_check(std::string&, std::string&)'
   16 | inline bool str_check(string& a, string&b) {
      |                       ~~~~~~~~^
Language: C++

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define CLR(mat) memset(mat, 0, sizeof(mat))
typedef long long ll;
int W, H;
vector<string> vs(70);
string ans;
bool checked[70][70]; 
bool calc(string a, string b) {
checked[h][w] = true;
  if(a.length() > b.length()) return true;
  if(a.length() < b.length()) return false;
  else return a > b;
}
void dfs(int h, int w, string s) {
  if(h < 0 || h >= H || w < 0 || w >= W || !isdigit(vs[h][w])) {
    if(calc(s, ans)) ans = s;
    return;
  }
  s += vs[h][w];
  dfs(h+1,w,s);
  dfs(h,w+1,s);
  return;
}
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  while(cin>>W>>H,W||H) {
    FOR(i,0,H) cin >> vs[i];
    ans = "";
    CLR(checked);
    FOR(h,0,H) {
      FOR(w,0,W) {
        if(checked[h][w]) continue;
        checked[h][w] = true;
        dfs(h, w, "");
      } 
    }
    cout << ans << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'bool calc(std::string, std::string)':
a.cc:25:9: error: 'h' was not declared in this scope
   25 | checked[h][w] = true;
      |         ^
a.cc:25:12: error: 'w' was not declared in this scope
   25 | checked[h][w] = true;
      |            ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#define rep(i, n) for(i = 0; i < n; i++)
using namespace std;

int w, h;
string s[70];
string dp[70][70];

bool check(int i, int j, string &prev) {
	if (i >= h || j >= w) return false;
	if (prev.length() > 0) {
		return '0' <= s[i][j] && s[i][j] <= '9';
	}
	return '1' <= s[i][j] && s[i][j] <= '9';
}

string Max(string &a, string &b) {
	if (a.length() > b.length()) return a;
	if (b.length() > a.length()) return b;
	return max(a, b);
}

int main() {
	int i, j;
	
	while (cin >> w >> h) {
		if (!w) break;
		rep(i, h) cin >> s[i];
		rep(i, h) {
			rep(j, w) {
				if ('1' <= s[i][j] && s[i][j] <= '9') dp[i][j] = s[i][j];
				else dp[i][j] = "";
			}
		}
		
		rep(i, h) {
			rep(j, w) {
				if (check(i + 1, j, dp[i][j])) dp[i + 1][j] = Max(dp[i + 1][j], dp[i][j] + s[i + 1][j]);
				if (check(i, j + 1, dp[i][j])) dp[i][j + 1] = Max(dp[i][j + 1], dp[i][j] + s[i][j + 1]);
			}
		}
		
		string ans = "";
		rep(i, h) {
			rep(j, w) {
				ans = Max(ans, dp[i][j]);
			}
		}
		cout << ans << endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:106: error: cannot bind non-const lvalue reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} to an rvalue of type 'std::__cxx11::basic_string<char>'
   40 |                                 if (check(i + 1, j, dp[i][j])) dp[i + 1][j] = Max(dp[i + 1][j], dp[i][j] + s[i + 1][j]);
a.cc:19:31: note:   initializing argument 2 of 'std::string Max(std::string&, std::string&)'
   19 | string Max(string &a, string &b) {
      |                       ~~~~~~~~^
a.cc:41:106: error: cannot bind non-const lvalue reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} to an rvalue of type 'std::__cxx11::basic_string<char>'
   41 |                                 if (check(i, j + 1, dp[i][j])) dp[i][j + 1] = Max(dp[i][j + 1], dp[i][j] + s[i][j + 1]);
a.cc:19:31: note:   initializing argument 2 of 'std::string Max(std::string&, std::string&)'
   19 | string Max(string &a, string &b) {
      |                       ~~~~~~~~^
Language: C++

#include<iostream>
#include<cstdio>
#include<string>
#include<vector>

using namespace std;

#define MAX 72

string ans;
char b[MAX][MAX];
int w,h;
vector<vector<string> > m;

static inline string maxstr(const string &a,const string &b){
  if(a.length()!=b.length()){
    if(a.length()>b.length()) return a;
    else return b;
  }else return max(a,b);
}

string memo(int x,int y,int d){
  if(x>=w||y>=h) return "";
  if(!isdigit(b[y][x])) return "";
  if(!m[y][x].empty()) return m[y][x];
  if(b[y][x]!='0') d++;
  m[y][x]=b[y][x]+maxstr(memo(x+1,y,d),memo(x,y+1,d));
  if(d==1&&b[y][x]!='0') ans=maxstr(ans,m[y][x]);
  return m[y][x];
}

int main(){
  while(scanf("%d%d ",&w,&h),w+h){
    m=vector<vector<string> >(h,vector<string>(w));
    for(int i=0;i<h;i++)
      gets(b[i]);
    ans="";
    for(int i=0;i<h;i++){
      for(int j=0;j<w;j++){
        if(!isdigit(b[i][j])||!m[i][j].empty()||(h-i+w-j)<ans.length())
	  continue;
        memo(j,i,0);
      }
    }
    cout << ans << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:7: error: 'gets' was not declared in this scope; did you mean 'getw'?
   36 |       gets(b[i]);
      |       ^~~~
      |       getw
Language: Java

#include<iostream>
#include<cmath>

using namespace std;
double x[100], y[100], z[100], r[100],sum,mn,maxd=99999999.9;
int n,m,mx=(1<<20),a,b,c,t,hozon;
double map[100][100];
double sumcor;
int p[100];
double d[100];
int visited[100];

double compute(int i, int j) {
  double ret;

  ret = sqrt((x[i]-x[j]) * (x[i]-x[j]) + (y[i]-y[j]) * (y[i]-y[j]) + (z[i]-z[j]) * (z[i]-z[j]));

  return ret;
}

int main(){
  while(1){
    cin>>n;
    if(n==0)break;

    for(int i=0;i<n;i++) {
      cin>>x[i]; cin>>y[i]; cin>>z[i]; cin>>r[i];
    }

    for(int i=0;i<n;i++){
      for(int j=0;j<n;j++){
	map[i][j]=maxd;
      }
      p[i]=0;
      d[i]=maxd;
      visited[i]=0;
    }
    
    for(int i=0; i<n; i++) {
      for(int j=0; j<n; j++) {
	if(i==j) continue;
	map[i][j] = compute(i, j);
	map[i][j]-=(r[i]+r[j]);
	if(map[i][j]<0)map[i][j]=0;
      }
    }


    for(int i=0;i<n;i++){
      for(int j=0;j<n;j++){
	//	cout<<map[i][j]<<endl;
      }
    }
    
    sumcor=0.0;
    d[0]=0.0;
    while(1){
      mn=maxd;
      for(int i=0;i<n;i++){
	if(d[i]<mn&&visited[i]==0){
	  mn=d[i];
	  t=i;
	}
      }
      if(mn==maxd)break;
      visited[t]=1;
      for(int v=0;v<n;v++){
	if(map[t][v]<d[v]&&visited[v]==0){
	  d[v]=map[t][v];
	  p[v]=t;
	}
      }
    }
    for(int i=0;i<n;i++)if(map[i][p[i]]!=maxd)sumcor+=map[i][p[i]];
    printf("%4.3f\n",sumcor);
  }
  return 0;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include<iostream>
^
Main.java:2: error: illegal character: '#'
#include<cmath>
^
Main.java:5: error: class, interface, enum, or record expected
double x[100], y[100], z[100], r[100],sum,mn,maxd=99999999.9;
^
Main.java:6: error: class, interface, enum, or record expected
int n,m,mx=(1<<20),a,b,c,t,hozon;
^
Main.java:7: error: class, interface, enum, or record expected
double map[100][100];
^
Main.java:8: error: unnamed classes are a preview feature and are disabled by default.
double sumcor;
^
  (use --enable-preview to enable unnamed classes)
Main.java:9: error: class, interface, enum, or record expected
int p[100];
^
Main.java:10: error: class, interface, enum, or record expected
double d[100];
^
Main.java:11: error: class, interface, enum, or record expected
int visited[100];
^
Main.java:23: error: not a statement
    cin>>n;
       ^
Main.java:27: error: not a statement
      cin>>x[i]; cin>>y[i]; cin>>z[i]; cin>>r[i];
         ^
Main.java:27: error: not a statement
      cin>>x[i]; cin>>y[i]; cin>>z[i]; cin>>r[i];
                    ^
Main.java:27: error: not a statement
      cin>>x[i]; cin>>y[i]; cin>>z[i]; cin>>r[i];
                               ^
Main.java:27: error: not a statement
      cin>>x[i]; cin>>y[i]; cin>>z[i]; cin>>r[i];
                                          ^
14 errors
Language: C

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)

double cost[101][101];
double mincost[101];
bool used[101];
double x[101], y[101], z[101], r[101];
double INF = numeric_limits<double>::max();
int main(void){
    int n;
    while(cin >> n && n) {
        rep(i, n) {
            cin >> x[i] >> y[i] >> z[i] >> r[i];
        }
        rep(i, n) rep(j, n) {
            cost[i][j] = max(sqrt(pow(x[i]-x[j], 2.0) + pow(y[i]-y[j], 2.0) + pow(z[i]-z[j], 2.0)) - r[i] - r[j], 0.0);
        }
        // prim
        rep(i, n) {
            mincost[i] = INF;
            used[i] = false;
        }
        mincost[0] = 0;
        double res = 0;

        while(true) {
            int v = -1;
            rep(u, n) {
                if(!used[u] && (v==-1 || mincost[u] < mincost[v])) v = u;
            }
            if(v == -1) break;
            used[v] = true;
            res += mincost[v];

            rep(u, n) {
                mincost[u] = min(mincost[u], cost[v][u]);
            }
        }
        printf("%.3lf\n", res);
    }
}



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

#include <bits/stdc++.h>
 
#define REP(i,n) for(int i=0; i<(int)(n); ++i)
#define FOR(i,k,n) for(int i=(k);i<(int)(n);++i)
typedef long long int ll;
using namespace std;

struct UnionFind {
  vector<int> par;
  vector<int> rank;

  UnionFind(int n) : par(n), rank(n, 1) {
    for(int i=0; i<n; ++i) par[i] = i;
  }

  int find(int x) {
    if (x == par[x]) return x;
    return par[x] = find(par[x]);
  }

  void unite(int x, int y) {
    x = find(x);
    y = find(y);
    if (x == y) return;
    if (rank[x] < rank[y]) swap(x, y);
    par[y] = x;
    rank[x] += rank[y];
  }

  bool same(int x, int y) {
    return find(x) == find(y);
  }
};

typedef double Cost;

struct edge{
    int src, dst; Cost cost;
    edge(int s, int t, Cost c) : src(s), dst(t), cost(c) {}
    bool operator < (const edge &rhs) const {return cost < rhs.cost;}
};

Cost kruskal(int V, vector<edge> &edges) {
    UnionFind uf(V);
    sort(edges.begin(), edges.end());
    Cost ans = 0;
    for(auto e : edges) {
        if(!uf.same(e.src, e.dst)) {
            uf.unite(e.src, e.dst);
            ans += e.cost;
        }
    }
    return ans;
}

int main(void) {
    int n;
    while(cin >> n && n) {
        vector<double> x(n), y(n), z(n), r(n);
        vector<edge> edges;
        REP(i, n) {
            cin >> x[i] >> y[i] >> z[i] >> r[i];
        }
        REP(i, n)  {
            REP(j, n) {
                if(i == j) continue;
                double c = sqrt(pow(x[i]-x[j], 2.0) + pow(y[i]-y[j], 2.0) + pow(z[i]-z[j], 2.0)) - r[i] - r[j];
                edges.push_back(edge(i, j, max(0.0, c)));
            }
        }
        printf("%.3f\n", kruskal(n, edges));
    }
}


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

/**********************
*@Name:
*
*@Author: Nervending
*@Describtion:
*@DateTime: 2017-10-16 19:48:25
***********************/
#include <iostream>
#include <string.h>
#include <algorithm>
#include <math.h>
using namespace std;
const int maxn=1e2+10;
const int maxm=1e4+1000;
int root[maxn];
struct node {
	int from,to;
	double cost;
}e[maxm];
bool cmp (node &a,node &b){
	return a.cost<b.cost;
}
int find (int a){
	if(root[a]==a)return a;
	else return root[a]=find(root[a]);
}
#define same(a,b) (find(a)==find(b))
void unite(int a,int b){
	a=find(a);
	b=find(b);
	root[a]=b;
}
double x[maxn],y[maxn],z[maxn],r[maxn];
int n,m,nume;
double ans;
void init(){
	memset(e,0,sizeof e);
	for(int i=0;i<maxn;i++){
		root[i]=i;
	}
	ans=0;
	nume=0;
}
void kruskal(){
	for(int i=0;i<nume;i++){
		int a=e[i].from,b=e[i].to;
		if(!same(a,b)){
			unite(a,b);
			ans+=e[i].cost;
		}
	}
}
double dst(int a,int b){
	double dx=(x[a]-x[b]);
	double dy=(y[a]-y[b]);
	double dz=(z[a]-z[b]);
	double d=sqrt(dx*dx+dy*dy+dz*dz);
	double dr=r[a]+r[b];
	if(d>=dr)return d-dr;
	else return -1;
}
int main(){
//	freopen("in.txt","r",stdin);
	while(~scanf("%d",&n)&&n){
		init();
		for(int i=0;i<n;i++){
			scanf("%lf%lf%lf%lf",&x[i],&y[i],&z[i],&r[i]);
		}
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				double cost=dst(i,j);
				if(cost>0){
					node t={i,j,cost};
					e[nume++]=t;
				}
				else {
					node t={i,j,0};
					e[nume++]=t;
				}
			}
		}
		sort(e,e+nume,cmp);
		kruskal();
		printf("%.3lf\n",ans);
	}
}

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

//kruskal tree
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
#define M 9999
int parent[M],a[M],b[M];
pair<double,int>node[M];
int root(int a){return parent[a]==a?a:parent[a]=root(parent[a]);}
int unite(int a,int b){
	int x=root(a),y=root(b);
	if(x==y)return 0;
	parent[x]=y;
	return 1;
}
int main(){
	int i,j,k,m,n;
	double x,y,z,r;
	for(;cin>>n,n;){
		vector<vector<double> >v;
		for(i=0;i<n;i++)cin>>x>>y>>z>>r,v.push_back({x,y,z,r});
		for(i=0;i<n;i++)parent[i]=i;
		for(m=i=0;i<n;i++)for(j=i+1;j<n;j++){
			for(x=k=0;k<3;k++)x+=(v[i][k]-v[j][k])*(v[i][k]-v[j][k]);
			x=sqrt(x)-v[i][3]-v[j][3];
			if(x<=0)unite(i,j);
			else a[m]=i,b[m]=j,node[m].first=x,node[m].second=m++;
		}
		sort(node,node+m);

		for(x=i=0;i<m;i++)if(unite(a[node[i].second],b[node[i].second]))x+=std::max(.0,node[i].first);
		cout<<x<<endl;
	}
}

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

#include <math.h>
#include <stdio.h>
#include <stdlib.h>

typedef struct {
	double x, y, z, r;
} Coord;
typedef struct {
	int from, to;
	double weight;
} Edge;

Coord coord[ 100 ];
int parent[ 100 ];
Edge edge[ 4950 ];

int compare( const void *a, const void *b ) {
	double at = (*(Edge *)a).weight, bt = (*(Edge *)b).weight;

	if ( at < bt )
		return -1;
	else
		return 1;
}

int find( int x ) {
	if ( parent[ x ] == x )
		return x;
	else
		return parent[ x ] = find( parent[ x ] );
}

void union( int x, int y ) {
	parent[ find( y ) ] = find( x );
}

int kruskal( int v, int e ) {
	int i;
	double sum;

	qsort( edge, e, sizeof(Edge), &compare );

	for ( i = 0; i < v; i++ )
		parent[ i ] = i;

	sum = 0.0;
	for ( i = 0; i < e; i++ )
		if ( find( edge[ i ].from ) != find( edge[ i ].to ) ) {
			union( edge[ i ].from, edge[ i ].to );
			sum += edge[ i ].weight;
		}

	return sum;
}

int main( void ) {
	int i, j;
	int n;

	while ( scanf( "%d", &n ), n ) {
		int cnt;
		double sum;

		for ( i = 0; i < n; i++ )
			scanf( "%lf %lf %lf %lf", &coord[ i ].x, &coord[ i ].y, &coord[ i ].z, &coord[ i ].r );

		cnt = 0;
		for ( i = 0; i < n; i++ )
			for ( j = i + 1; j < n; j++ ) {
				edge[ cnt ].from = i;
				edge[ cnt ].to = j;
				edge[ cnt ].weight = fmax( hypot( hypot( coord[ i ].x - coord[ j ].x, coord[ i ].y - coord[ j ].y ), coord[ i ].z - coord[ j ].z ) - coord[ i ].r - coord[ j ].r, 0.0 );
				cnt++;
			}

		printf( "%.3f\n", kruskal( n, cnt ) );
	}

	return 0;
}

Compiler output:
main.c:33:11: error: expected '{' before '(' token
   33 | void union( int x, int y ) {
      |           ^
main.c:33:6: error: two or more data types in declaration specifiers
   33 | void union( int x, int y ) {
      |      ^~~~~
main.c: In function 'kruskal':
main.c:49:30: error: expected '{' before '(' token
   49 |                         union( edge[ i ].from, edge[ i ].to );
      |                              ^
Language: C++

3
10.000 10.000 50.000 10.000
40.000 10.000 50.000 10.000
40.000 40.000 50.000 10.000
2
30.000 30.000 30.000 20.000
40.000 40.000 40.000 20.000
5
5.729 15.143 3.996 25.837
6.013 14.372 4.818 10.671
80.115 63.292 84.477 15.120
64.095 80.924 70.029 14.881
39.472 85.116 71.369 5.553
0

Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 3
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <cstring>
#include <string>
#include <algorithm>
#include <iomanip>
using namespace std;

const int MAX = 100;

int par[MAX];
int rnk[MAX];
int nodeNum[MAX];

void init(int n) {
	for(int i = 0; i < n; i++) {
		par[i] = i;
		rnk[i] = 0;
		nodeNum[i] = 1;
	}
}

int find(int x) {
	if(par[x] == x) {
		return x;
	}
	else {
		return par[x] = find(par[x]);
	}
}

void unite(int x, int y) {
	x = find(x);
	y = find(y);
	if(x == y) return;

	if(rnk[x] < rnk[y]) {
		par[x] = y;
	}
	else {
		par[y] = x;
		if(rnk[x] == rnk[y]) rnk[x]++;
	}
	nodeNum[x] = nodeNum[y] = nodeNum[x] + nodeNum[y];
}

bool same(int x, int y) {
	return find(x) == find(y);
}

typedef double W;
struct edge {
	int u, v;
	W cost;
};

bool comp(const edge& e1, const edge& e2) {
	return e1.cost < e2.cost;
}

vector<edge> es;

W kruskal(int V, int E) {
	sort(es.begin(), es.end(), comp);
	init(V);
	W res = 0;
	for(int i = 0; i < E; i++) {
		edge e = es[i];
		if(!same(e.u, e.v)) {
			unite(e.u, e.v);
			res += e.cost;
		}
	}
	return res;
}

double x[100], y[100], z[100], r[100];

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int N;
	while(cin >> N, N) {
		for(int i = 0; i < N; i++) {
			cin >> x[i] >> y[i] >> z[i] >> r[i];
		}
		es.clear();
		for(int i = 0; i < N; i++) {
			for(int j = i + 1; j < N; j++) {
				double d = sqrt((x[i] - x[j]) * (x[i] - x[j]) +
					(y[i] - y[j]) * (y[i] - y[j]) +
					(z[i] - z[j]) * (z[i] - z[j]));
				d = max(0.0, d - r[i] - r[j]);
				es.push_back(edge{ i, j, d });
			}
		}
		double ans = kruskal(N, es.size());
		cout << setprecision(12) << ans << endl;
	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:91:44: error: 'sqrt' was not declared in this scope
   91 |                                 double d = sqrt((x[i] - x[j]) * (x[i] - x[j]) +
      |                                            ^~~~
Language: C++

#include <cmath>
#include <queue>
#include <vector>
#include <iostream>
#define INF 1e16
using namespace std;
// ------ Class ------ //
class Graph2 {
public:
	// ------ Variables ------ //
	int V, E; vector<vector<pair<int, long double> > > G;

	// ------ Constructors ------ //
	Graph2() : V(0), E(0), G(vector<vector<pair<int, long double> > >()) {}
	Graph2(int v) : V(v), E(0), G(vector<vector<pair<int, long double> > >(v)) {}
	Graph2(vector<vector<pair<int, long double> > > g) : V(g.size()), G(g) { for (int i = 0; i < g.size(); i++) E += g[i].size(); }

	// ------ Basic Functions ------ //
	int size() { return V; }
	void add1(int v1, int v2, long double w) { G[v1].push_back(make_pair(v2, w)); E++; }
	void add2(int v1, int v2, long double w) { add1(v1, v2, w); add1(v2, v1, w); }

	// ------ Operators ------ //
	bool operator==(const Graph2& g) const { return G == g.G; }
	bool operator!=(const Graph2& g) const { return G != g.G; }
	vector<pair<int, long double> > operator[](int x) { return G[x]; }

	// ------ Algorithms ------ //
	long double minspan() {
		vector<long double> d(V, INF);
		vector<bool> used(V, false);
		priority_queue<pair<long double, int> > que;
		for (int i = 0; i < V; i++) d[i] = INF;
		d[0] = 0; que.push(make_pair(0, 0));
		while (!que.empty()) {
			pair<long double, int> pa = que.top(); que.pop();
			int u = pa.second; used[u] = true;
			for (int i = 0; i < G[u].size(); i++) {
				int v = G[u][i].first;
				if (d[v] > G[u][i].second && !used[v]) {
					d[v] = G[u][i].second; que.push(make_pair(-d[v], v));
				}
			}
		}
		long double sum = 0;
		for (int i = 0; i < V; i++) sum += d[i];
		return sum;
	}
};
// ------ Main ------ //
int n; long double x[111], y[111], z[111], r[111];
int main() {
	while(cin >> n, n) {
		for(int i = 0; i < n; i++) cin >> x[i] >> y[i] >> z[i] >> r[i];
		Graph2 G(n);
		for(int i = 0; i < n; i++) {
			for(int j = i + 1; j < n; j++) {
				long double dist = sqrtl((x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]) + (z[i] - z[j]) * (z[i] - z[j]));
				G.add2(i, j, (dist > r[i] + r[j]) ? (dist - r[i] - r[j]) : 0)
			}
		}
		cout << G.minspan() << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:94: error: expected ';' before '}' token
   59 |                                 G.add2(i, j, (dist > r[i] + r[j]) ? (dist - r[i] - r[j]) : 0)
      |                                                                                              ^
      |                                                                                              ;
   60 |                         }
      |                         ~
Language: C++

#include <iostream>
#include <vector>
#include <cstdio>
#include <cmath>
#define REP(i, a, n) for(int i = (a); i < (n); i++)
using namespace std;

struct edge {
  int p, q;
  double d;
  bool operator<(const edge &e) const { return d < e.d; }
};

int N;
double X[100], Y[100], Z[100], R[100];

double dist(int i, int j) {
  double dx = X[i] - X[j];
  double dy = Y[i] - Y[j];
  double dz = Z[i] - Z[j];
  return max(sqrt(dx * dx + dy * dy + dz * dz) - R[i] - R[j], 0.0);
}

int find(int *a, int i) { return a[i] == i ? i : (a[i] = find(a, a[i])); }
void unite(int *a, int i, int j) { if(find(a, i) != find(a, j)) a[find(a, i)] = find(a, j); }

int main(void) {
  while(cin >> N, N) {
    REP(i, 0, N) cin >> X[i] >> Y[i] >> Z[i] >> R[i];

    vector<edge> e;
    REP(i, 0, N) REP(j, i + 1, N) e.push_back((edge) { i, j, dist(i, j) });
    sort(e.begin(), e.end());

    double ans = 0.0;
    int g[100];
    REP(i, 0, N) g[i] = i;
    REP(i, 0, e.size()) if(find(g, e[i].p) != find(g, e[i].q)) {
      ans += e[i].d;
      unite(g, e[i].p, e[i].q);
    }
    printf("%.5lf\n", ans);
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   33 |     sort(e.begin(), e.end());
      |     ^~~~
      |     sqrt