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

#include <bits/stdc++.h>
using namespace std;

long long toLong(string str, int n)
{
	long long res = 0;
	for (int i = 0; i < str.size(); i++){
		if (str[i] != 'X'){
			res = res * 10 + str[i] - '0';
		}
		else {
			//if (i == 0 && n == 0) return 0;
			res = res * 10 + n;
		}
	}
	return res;
}

int main()
{
	//char A[128], B[128], C[128];
	while (true){
		string str[3];
		string line;
		if (!(cin >> line)) return 0;
		
		for (int p = 0, i = 0; p < line.size(); p++){
			if (line[p] != '+' && line[p] != '='){
				str[i] += line[p];
			}
			else {
				i++;
			}
		}
		
		int res = -1;
		for (int i = 0; i <= 9; i++){
			if (toLong(str[0], i) + toLong(str[1], i) - toLong(str[2], i) == 0)){
				res = i;
			}
		}
		
		if (res != -1) printf("%d\n", res);
		else puts("NA");
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:92: error: expected primary-expression before ')' token
   38 |                         if (toLong(str[0], i) + toLong(str[1], i) - toLong(str[2], i) == 0)){
      |                                                                                            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

long long toLong(string str, int n)
{
	long long res = 0;
	for (int i = 0; i < str.size(); i++){
		if (str[i] != 'X'){
			res = res * 10 + str[i] - '0';
		}
		else {
			//if (i == 0 && n == 0) return 0;
			res = res * 10 + n;
		}
	}
	return res;
}

int main()
{
	//char A[128], B[128], C[128];
	while (true){
		string str[3];
		string line;
		if (!(cin >> line)) return 0;
		
		for (int p = 0, i = 0; p < line.size(); p++){
			if (line[p] != '+' && line[p] != '='){
				str[i] += line[p];
			}
			else {
				i++;
			}
		}
		
		int res = -1;
		for (int i = 0; i <= 9; i++){
			if (toLong(str[0], i) + toLong(str[1], i) - toLong(str[2], i) == 0LL)){
				res = i;
			}
		}
		
		if (res != -1) printf("%d\n", res);
		else puts("NA");
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:94: error: expected primary-expression before ')' token
   38 |                         if (toLong(str[0], i) + toLong(str[1], i) - toLong(str[2], i) == 0LL)){
      |                                                                                              ^
Language: C++

/*
	AOJ_0110: Alphametic
*/
#include	<iostream>
#include	<string>
#include	<cstdlib>
#include	<vector>

using namespace std;

int Alp_calc(string);
string convert_Xtoi(string, int);
string calc_AddofNumString(string, string);

int main(void) {
	string str;
	int result;

	while (1) {
		cin >> str;
		if (cin.eof()) { break; }

		result = Alp_calc(str);
		if (result != -1) { cout << result << endl; }
		else { cout << "NA" << endl; }
	}
	return 0;
}

int Alp_calc(string str) {
	string sect_1, sect_2, solution;

	string::iterator it = str.begin();
	while (*it != '+') {
		sect_1 += *it;
		it++;
	} it++;
	while (*it != '=') {
		sect_2 += *it;
		it++;
	} it++;
	while (it != str.end()) {
		solution += *it;
		it++;
	}
	for (int i = 0; i < 10; i++) {
		string _bf1, _bf2, _bfs, _buff;

		_bf1 = convert_Xtoi(sect_1, i);
		_bf2 = convert_Xtoi(sect_2, i);
		_bfs = convert_Xtoi(solution, i);

		_buff = calc_AddofNumString(_bf1, _bf2);
		if (strcmp(_buff.c_str(), _bfs.c_str()) == 0) { return i; }
	}

	return -1;
}

string convert_Xtoi(string str, int n) {
	string::iterator it = str.begin();
	while (it != str.end()) {
		if (*it == 'X') { *it = n + '0'; }
		it++;
	}
	return str;
}

string calc_AddofNumString(string str1, string str2) {
	bool f1 = false, f2 = false, carry = false;
	char bb;
	int s1_i = 0, s2_i = 0;
	const int s1_mx = str1.length(), s2_mx = str2.length();
	string result;

	reverse(str1.begin(), str1.end());
	reverse(str2.begin(), str2.end());
	while ((s1_i < s1_mx) || (s2_i < s2_mx) || carry == true) {
		if (carry == true) { bb = '1'; carry = false; }
		else { bb = '0'; }
		if (s1_i < s1_mx) { bb += str1.at(s1_i) - '0'; }
		if (s2_i < s2_mx) { bb += str2.at(s2_i) - '0'; }
		if (bb > '9') { bb -= 10; carry = true; }
		result += bb;
		s1_i++; s2_i++;
	}

	reverse(result.begin(), result.end());
	return result;
}

Compiler output:
a.cc: In function 'int Alp_calc(std::string)':
a.cc:54:21: error: 'strcmp' was not declared in this scope
   54 |                 if (strcmp(_buff.c_str(), _bfs.c_str()) == 0) { return i; }
      |                     ^~~~~~
a.cc:8:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    7 | #include        <vector>
  +++ |+#include <cstring>
    8 | 
a.cc: In function 'std::string calc_AddofNumString(std::string, std::string)':
a.cc:76:9: error: 'reverse' was not declared in this scope
   76 |         reverse(str1.begin(), str1.end());
      |         ^~~~~~~
Language: C++

/*
	AOJ_0110: Alphametic
*/
#include	<iostream>
#include	<string>
#include	<cstdlib>
#include	<vector>

using namespace std;

int Alp_calc(string);
string convert_Xtoi(string, int);
string calc_AddofNumString(string, string);

int main(void) {
	string str;
	int result;

	while (1) {
		cin >> str;
		if (cin.eof()) { break; }

		result = Alp_calc(str);
		if (result != -1) { cout << result << endl; }
		else { cout << "NA" << endl; }
	}
	return 0;
}

int Alp_calc(string str) {
	string sect_1, sect_2, solution;

	string::iterator it = str.begin();
	while (*it != '+') {
		sect_1 += *it;
		it++;
	} it++;
	while (*it != '=') {
		sect_2 += *it;
		it++;
	} it++;
	while (it != str.end()) {
		solution += *it;
		it++;
	}
	for (int i = 0; i < 10; i++) {
		string _bf1, _bf2, _bfs, _buff;

		_bf1 = convert_Xtoi(sect_1, i);
		_bf2 = convert_Xtoi(sect_2, i);
		_bfs = convert_Xtoi(solution, i);

		_buff = calc_AddofNumString(_bf1, _bf2);
		if (_buff == _bfs) { return i; }
	}

	return -1;
}

string convert_Xtoi(string str, int n) {
	string::iterator it = str.begin();
	while (it != str.end()) {
		if (*it == 'X') { *it = n + '0'; }
		it++;
	}
	return str;
}

string calc_AddofNumString(string str1, string str2) {
	bool f1 = false, f2 = false, carry = false;
	char bb;
	int s1_i = 0, s2_i = 0;
	const int s1_mx = str1.length(), s2_mx = str2.length();
	string result;

	reverse(str1.begin(), str1.end());
	reverse(str2.begin(), str2.end());
	while ((s1_i < s1_mx) || (s2_i < s2_mx) || carry == true) {
		if (carry == true) { bb = '1'; carry = false; }
		else { bb = '0'; }
		if (s1_i < s1_mx) { bb += str1.at(s1_i) - '0'; }
		if (s2_i < s2_mx) { bb += str2.at(s2_i) - '0'; }
		if (bb > '9') { bb -= 10; carry = true; }
		result += bb;
		s1_i++; s2_i++;
	}

	reverse(result.begin(), result.end());
	return result;
}

Compiler output:
a.cc: In function 'std::string calc_AddofNumString(std::string, std::string)':
a.cc:76:9: error: 'reverse' was not declared in this scope
   76 |         reverse(str1.begin(), str1.end());
      |         ^~~~~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;

int check(int,int);

int main(){
	string s;
	string a,b,c;
	int an,bn,cn;
	int A,B,C;
	int i,tmp;
	int X;
	
	while(1){
	 cin>>s;s+='e';
	 a=b=c="";an=bn=cn=0;
	 i=0;while(s[i]=='+'){
	  a+=s[i];an++;
	  i++;
	 }
	 i++;while(s[i]=='='){
	  b+=s[i];bn++;
	  i++;
	 }
	 i++;while(s[i]=='e'){
	  c+=s[i];cn++;
	  i++;
	 }
	 
	 A=B=C=0;
	 for(X=0;X<10;x++;){
	  for(i=0;i<an;i++){
	   A*=10;
	   tmp=isNum(a[i]);
	   A+=(tmp==-1)?X:tmp;
	  }
	  for(i=0;i<bn;i++){
	   B*=10;
	   tmp=isNum(b[i]);
	   B+=(tmp==-1)?X:tmp;
	  }
	  for(i=0;i<cn;i++){
	   C*=10;
	   tmp=isNum(c[i]);
	   C+=(tmp==-1)?X:tmp;
	  }
	  if(A+B==C){break;}
	 }
	 
	 if(X==10){cout<<"NA"<<endl;}else{cout<<X<<endl;}
	}
	
	return 0;
}

int isNum(int c){
	if(48<=c && c<=57){
	 return c-48;
	}
	return -1;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:23: error: 'x' was not declared in this scope
   32 |          for(X=0;X<10;x++;){
      |                       ^
a.cc:32:26: error: expected ')' before ';' token
   32 |          for(X=0;X<10;x++;){
      |             ~            ^
      |                          )
a.cc:32:27: error: expected primary-expression before ')' token
   32 |          for(X=0;X<10;x++;){
      |                           ^
Language: C++

#include <iostream>
#include <string>
using namespace std;

int check(int,int);

int isNum(int c){
	if(48<=c && c<=57){
	 return c-48;
	}
	return -1;
}

int main(){
	string s;
	string a,b,c;
	int an,bn,cn;
	int A,B,C;
	int i,tmp;
	int X;
	
	while(1){
	 cin>>s;s+='e';
	 a=b=c="";an=bn=cn=0;
	 i=0;while(s[i]=='+'){
	  a+=s[i];an++;
	  i++;
	 }
	 i++;while(s[i]=='='){
	  b+=s[i];bn++;
	  i++;
	 }
	 i++;while(s[i]=='e'){
	  c+=s[i];cn++;
	  i++;
	 }
	 
	 A=B=C=0;
	 for(X=0;X<10;X++;){
	  for(i=0;i<an;i++){
	   A*=10;
	   tmp=isNum(a[i]);
	   A+=(tmp==-1)?X:tmp;
	  }
	  for(i=0;i<bn;i++){
	   B*=10;
	   tmp=isNum(b[i]);
	   B+=(tmp==-1)?X:tmp;
	  }
	  for(i=0;i<cn;i++){
	   C*=10;
	   tmp=isNum(c[i]);
	   C+=(tmp==-1)?X:tmp;
	  }
	  if(A+B==C){break;}
	 }
	 
	 if(X==10){cout<<"NA"<<endl;}else{cout<<X<<endl;}
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:26: error: expected ')' before ';' token
   39 |          for(X=0;X<10;X++;){
      |             ~            ^
      |                          )
a.cc:39:27: error: expected primary-expression before ')' token
   39 |          for(X=0;X<10;X++;){
      |                           ^
Language: C++

#include <iostream>
#include <string>
using namespace std;

int check(int,int);

int isNum(int c){
	if(48<=c && c<=57){
	 return c-48;
	}
	return -1;
}

int main(){
	string s;
	string a,b,c;
	int an,bn,cn;
	int A,B,C;
	int i,tmp;
	int X;
	
	while(1){
	 cin>>s;s+='e';
	 a="";b="";c="";an=0;bn=0;cn=0;
	 i=0;while(s[i]=='+'){
	  a+=s[i];an++;
	  i++;
	 }
	 i++;while(s[i]=='='){
	  b+=s[i];bn++;
	  i++;
	 }
	 i++;while(s[i]=='e'){
	  c+=s[i];cn++;
	  i++;
	 }
	 
	 A=0;B=0;C=0;
	 for(X=0;X<10;X++;){
	  for(i=0;i<an;i++){
	   A*=10;
	   tmp=isNum(a[i]);
	   if(tmp==-1){A+=X;}else{A+=tmp;}
	  }
	  for(i=0;i<bn;i++){
	   B*=10;
	   tmp=isNum(b[i]);
	   if(tmp==-1){B+=X;}else{B+=tmp;}
	  }
	  for(i=0;i<cn;i++){
	   C*=10;
	   tmp=isNum(c[i]);
	   if(tmp==-1){C+=X;}else{C+=tmp;}
	  }
	  if(A+B==C){break;}
	 }
	 
	 if(X==10){cout<<"NA"<<endl;}else{cout<<X<<endl;}
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:26: error: expected ')' before ';' token
   39 |          for(X=0;X<10;X++;){
      |             ~            ^
      |                          )
a.cc:39:27: error: expected primary-expression before ')' token
   39 |          for(X=0;X<10;X++;){
      |                           ^
Language: C++

import sys

for s in sys.stdin:
    p=s.split("=")

    ans="NA"

    st=0
    tmp=p[0].split("+")
    if tmp[0][0]=="X" or tmp[1][0]=="X" or p[1][0]=="X":
        st=1

    for i in range(st,10):
        a=eval(p[0].replace("X",str(i)))
        b=eval(p[1].replace("X",str(i)))
        if a==b:
            ans=i
            break

    print(ans)

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

import sys
import re
for line in sys.stdin:
	line=re.split('[+=]',line)
	flag=True
	for i in range(10):
		if(line[0][0]=='X'or line[1][0]=='X'or line[2][0]=='X')and i==0:continue
		cnt=0
		for j in range(2):
			s=line[j]
			s=s.replace('X',str(i))
			cnt+=int(s)
		s=line[2]
		s=s.replace('X',str(i))
		if cnt==int(s):
			flag=False
			print(i)
			break
	if flag:print("NA")

Compiler output:
a.cc:4:23: warning: multi-character character constant [-Wmultichar]
    4 |         line=re.split('[+=]',line)
      |                       ^~~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

while expr = gets
  if expr.chomp == ""
    break
  end
 
  flag = false
  a1, a2, ans =  expr.chomp.split(/[\+|=]/)

  (0..9).each do |i|  
    tmp_a1 = a1.gsub("X", i.to_s).to_i
    tmp_a2 = a2.gsub("X", i.to_s).to_i
    tmp_ans = ans.gsub("X", i.to_s).to_i

    if (tmp_a1 + tmp_a2 == tmp_ans)
      puts i
      flag = true
      break
    end
  end

  if !flag
    puts "NA"
  end
end

Compiler output:
a.cc:7:37: error: stray '\' in program
    7 |   a1, a2, ans =  expr.chomp.split(/[\+|=]/)
      |                                     ^
a.cc:9:4: error: too many decimal points in number
    9 |   (0..9).each do |i|
      |    ^~~~
a.cc:1:1: error: expected unqualified-id before 'while'
    1 | while expr = gets
      | ^~~~~
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main() {
	string a;
	while (cin >> a) {
		int d, e = 0;
		a += "+";
		string l="";
		for (int i = 0; i < 10; i++) {
			string h = "",b[3];
			int  c = 0;
			string f = "", o = "";
			for (int j = 0; j < a.length(); j++) {
				if (a[j] == '+' || a[j] == '=') {
					if (h[0] == '0'&&h.length()!=1) goto stop;
					b[c]= h;
					c++;
					h = "";
				}
				else {
					if (a[j] == 'X')
						h += to_string(i);
					else
						h += a[j];
				}
			}
			f=b[0];
			for (int j = b[0].length()-1; j >=0; j--) 
				f[b[0].length() - 1-j] = b[0][j];
			b[0] = f;
			f = b[1];
			for (int j = b[1].length() - 1; j >= 0; j--)
				f[b[1].length() - 1 - j] = b[1][j];
			b[1] = f;
			f = "";
			bool g= false;
			for (int j = 0; j < max(b[0].length(), b[1].length()); j++) {
				if (j < b[0].length() && j < b[1].length()) {
					int k = (int)b[0][j] - '0' + b[1][j] - '0';
					if (g) {
						k++;
						g = false;
					}
					if (k >= 10) {
						k -= 10; g = true;
					}
					f += to_string(k);
				}
				else if (j < b[0].length()) {
					int k = (int)b[0][j] - '0';
					if (g) {
						k++;
						g = false;
					}
					if (k >= 10) {
						k -= 10;
						g = true;
					}
					f += to_string(k);
				}
				else {
					int k = (int)b[1][j] - '0';
					if (g) {
						k++;
						g = false;
					}
					if (k >= 10) {
						k -= 10;
						g = true;
					}
					f += to_string(k);
				}
			}
			if(g) f+="1";
			o = "";
			for (int i = f.length() - 1; i >= 0; i--)
				h += f[i];
			f = h;
			if (f == b[2]) {
				l = to_string(i);
				e++;
			}
		stop:;
		}
		if (e==0)
			cout << "NA" << endl;
		else
			cout << l << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:85:17: error: jump to label 'stop'
   85 |                 stop:;
      |                 ^~~~
a.cc:17:78: note:   from here
   17 |                                         if (h[0] == '0'&&h.length()!=1) goto stop;
      |                                                                              ^~~~
a.cc:38:30: note:   crosses initialization of 'bool g'
   38 |                         bool g= false;
      |                              ^
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main() {
	string a="sdghjkl";
	while (cin >> a) {
		int d, e = 0;
		a += "+";
		string l="";
		for (int i = 0; i < 10; i++) {
			string h = "",b[3];
			int  c = 0;
			string f = "", o = "";
			for (int j = 0; j < a.size(); j++) {
				if (a[j] == '+' || a[j] == '=') {
					if (h[0] == '0'&&h.length()!=1) goto stop;
					b[c]= h;
					c++;
					h = "";
				}
				else {
					if (a[j] == 'X')
						h += to_string(i);
					else
						h += a[j];
				}
			}
			f=b[0];
			for (int j = b[0].size()-1; j >=0; j--) 
				f[b[0].length() - 1-j] = b[0][j];
			b[0] = f;
			f = b[1];
			for (int j = b[1].size() - 1; j >= 0; j--)
				f[b[1].length() - 1 - j] = b[1][j];
			b[1] = f;
			f = "";
			bool g= false;
			for (int j = 0; j < max(b[0].size(), b[1].size()); j++) {
				if (j < b[0].size() && j < b[1].size()) {
					int k = (int)b[0][j] - '0' + b[1][j] - '0';
					if (g) {
						k++;
						g = false;
					}
					if (k >= 10) {
						k -= 10; g = true;
					}
					f += to_string(k);
				}
				else if (j < b[0].size()) {
					int k = (int)b[0][j] - '0';
					if (g) {
						k++;
						g = false;
					}
					if (k >= 10) {
						k -= 10;
						g = true;
					}
					f += to_string(k);
				}
				else {
					int k = (int)b[1][j] - '0';
					if (g) {
						k++;
						g = false;
					}
					if (k >= 10) {
						k -= 10;
						g = true;
					}
					f += to_string(k);
				}
			}
			if(g) f+="1";
			o = "";
			for (int i = f.length() - 1; i >= 0; i--)
				h += f[i];
			f = h;
			if (f == b[2]) {
				l = to_string(i);
				e++;
				break;
			}
		stop:;
		}
		if (e==0)
			cout << "NA" << endl;
		else
			cout << l << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:86:17: error: jump to label 'stop'
   86 |                 stop:;
      |                 ^~~~
a.cc:17:78: note:   from here
   17 |                                         if (h[0] == '0'&&h.length()!=1) goto stop;
      |                                                                              ^~~~
a.cc:38:30: note:   crosses initialization of 'bool g'
   38 |                         bool g= false;
      |                              ^
Language: C++

while e = gets
    equation = e.chomp.sub!(/=/, '+').split('+')
    flag = false
    
    for i in 0..9
        sec1, sec2, sec3 = "", "", ""
        sec1 = equation[0].gsub("X", i.to_s)
        sec2 = equation[1].gsub("X", i.to_s)
        sec3 = equation[2].gsub("X", i.to_s)
        
       
        if sec1.to_i + sec2.to_i == sec3.to_i
            puts i
            flag = true
            break
        end
    end
    puts "NA" if flag == false
end


Compiler output:
a.cc:5:14: error: too many decimal points in number
    5 |     for i in 0..9
      |              ^~~~
a.cc:1:1: error: expected unqualified-id before 'while'
    1 | while e = gets
      | ^~~~~
Language: C++

#include <iostream>
#include <sstream>
#include <string>
using namespace std;
int main( void )
{
	string in;
	while ( cin >> in )
	{
		bool found = false;
		for ( int i = 0; i < 10; i++ )
		{
			string ex = in;
			replace( ex.begin(), ex.end(), 'X', (char)('0'+i) );
			replace( ex.begin(), ex.end(), '+', ' ' );
			replace( ex.begin(), ex.end(), '=', ' ' );

			istringstream is(ex);
			string a, b, c;
			is >> a >> b >> c;

			if ( a[0] == '0' || b[0] == '0' || c[0] == '0' )
				continue;

			istringstream is2( ex );
			int aa, bb, cc;
			is2 >> aa >> bb >> cc;
			
			if ( aa + bb == cc )
			{
				cout << i << endl;
				found = true;
				break;
			}
		}

		if ( found == false )
			cout << "NA" << endl;
		
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:25: error: 'replace' was not declared in this scope
   14 |                         replace( ex.begin(), ex.end(), 'X', (char)('0'+i) );
      |                         ^~~~~~~
Language: C++

#include<stdio.h>
#include<string.h>
char*p,E0[128],E1[128],da[128],db[128],dc[128],X;
C(){
	int ia,ib,ic,v;
	for(v=ia=ib=ic=0;dc[ic];){
		if(da[ia])
			v+=da[ia++]-'0';
		if(db[ib])
			v+=db[ib++]-'0';
		if(v%10+'0'!=dc[ic++])
			return 0;
		v/=10;
	}
	if(v||da[ia]||db[ib])
		return 0;
	return 1;
}
main(){
	for(;~scanf("%[^\n]\n",E0);){
		for(X='0';X<='9';X++){
			strcpy(E1,E0);
			while(p=strchr(E1,'X'))
				*p=X;
			sscanf(E1,"%[^+]+%[^=]=%s",da,db,dc);
			if(*da=='0'&&da[1]||*db=='0'&&db[1]||*dc=='0'&&dc[1])
				continue;
			strrev(da);
			strrev(db);
			strrev(dc);
			if(C()){
				printf("%c\n",X);
				break;
			}
		}
		if(X=='9'+1)
			puts("NA");
	}
}

Compiler output:
a.cc:4:1: error: ISO C++ forbids declaration of 'C' with no type [-fpermissive]
    4 | C(){
      | ^
a.cc:19:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   19 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:28:25: error: 'strrev' was not declared in this scope; did you mean 'strsep'?
   28 |                         strrev(da);
      |                         ^~~~~~
      |                         strsep
Language: C++

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

int main(void)
{
	char str[256];
	int xpos[256];
	int xcnt;
	int n;
	
	while (fgets(str, 256, stdin) != NULL){
		xcnt = 0;
		for (int i = 0; str[i] != '\n'; i++){
			if (str[i] == 'X'){
				xpos[xcnt++] = i;
			}
		}
		
		int i;
		for (i = '0'; i <= '9'; i++){
			for (int j = 0; j < xcnt; j++){
				str[xpos[j]] = i;
			}
			int j = 0;
			if (i == '0' && str[0] == '0' && str[1] != '+'){
				continue;
			}
			n = atoi(str);
			while (str[j] != '+')j++;
			j++;
			if (i == '0' && str[j + 1] != '=' && str[j] == '0'){
				continue;a
			}
			n += atoi(&str[j]);
			while (str[j] != '=')j++;
			j++;
			
			if (i == '0' && str[j + 1] != '\n' && str[j] == '0'){
				continue;
			}
			if (n == atoi(&str[j])) {
				printf("%c\n", i);
				break;
			}
		}
		if (i == '9' + 1){
			puts("NA");
		}
	}
	
	return (0);
}

Compiler output:
a.cc:3:20: warning: extra tokens at end of #include directive
    3 | #include <stdlib.h>>
      |                    ^
a.cc: In function 'int main()':
a.cc:33:42: error: 'a' was not declared in this scope
   33 |                                 continue;a
      |                                          ^
Language: C++

import java.util.Scanner;

//Alphametic
public class AOJ0110 {

	static char[] s;
	static int id;
	
	static boolean exp(){
		int a = fact();
		if(a==-1)return false;
		while(true){
			char c = s[id++];
			if(c=='=')break;
			int x = fact();
			if(x==-1)return false;
			a+=x;
		}
		int b = fact();
		if(b==-1)return false;
		return a==b;
	}
	
	static int fact(){
		int x = s[id++]-'0';
		if(x==0&&Character.isDigit(s[id]))return -1;
		while(Character.isDigit(s[id])){
			x *= 10;
			x += s[id++]-'0';
		}
		return x;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			String r = sc.next();
			String ans = "NA";
			for(int i=0;i<10;i++){
				s = (r.replace("X", (char)(i+'0')+"")+"$").toCharArray();
				id = 0;
				if(exp()){
					ans = i+"";
					break;
				}
			}
			System.out.println(ans);
		}
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: expected unqualified-id before 'public'
    4 | public class AOJ0110 {
      | ^~~~~~
Language: C++

import java.math.*;
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    
    while (sc.hasNext()) {
      String line = sc.next();
      boolean flag = false;
      for (char c = '0'; c <= '9'; ++c) {
        String temp = line;
        temp = temp.replace('X', c);
        String[] elem = temp.split("[^0-9]");

        boolean ok = true;
        for (int i = 0; i < 3; ++i) {
          if (elem[i].length > 1 && elem[i].charAt(0) == '0') {
            ok = false;
          }
        }
        if (!ok) continue;

        BigInteger l1 = new BigInteger(elem[0]);
        BigInteger l2 = new BigInteger(elem[1]);
        BigInteger r = new BigInteger(elem[2]);

        l1 = l1.add(l2);
        if (l1.equals(r)) {
          System.out.println(c); flag = true; break;
        }
      }
      if (!flag) {
        System.out.println("NA");
      }
    }
    
  }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.math.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: expected unqualified-id before 'public'
    4 | public class Main {
      | ^~~~~~
Language: C++

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

#define X(a) (a=='X'?i:a-'0')

int resX(char *p[3]){
	int c[10]={0},i,x[10]={0};
	while(*p[2]){
		for(i=0;i<10;i++)
			if(X(*p[0]) + X(*p[1]) + c[i] == X(*p[2])) c[i] = 0;
			else if(X(*p[0]) + X(*p[1]) - 10 + c[i] == X(*p[2])) c[i] = 1;
			else x[i] = 1;
			p[0]++;p[1]++;p[2]++;
	}
	for(i=0;i<10;i++) if(!x[i]) return i;
	return -1;
}

int main(){
	long i,j,n;
	char buf[150], p;
	while(fgets(buf, 130, stdin)){
		char *p, *num[3], sp[3][150]={{0},{0},{0}};
		strrev(buf);
		num[2] = buf+1;
		*(p=strchr(buf, '='))=0;
		num[1]=++p;
		*(p=strchr(p, '+'))=0;
		num[0]=++p;
		cout << num[0] << "," << num[1] << "," << num[2] << endl;
		strcpy(sp[0], num[0]);
		for(i=strlen(sp[0]);i<126;i++) sp[0][i] = '0';
		strcpy(sp[1], num[1]);
		for(i=strlen(sp[1]);i<126;i++) sp[1][i] = '0';
		strcpy(sp[2], num[2]);
		num[0]=sp[0];num[1]=sp[1];num[2]=sp[2];
		int ret = resX(num);
		if(ret < 0) cout << "NA" <<endl;
		else cout << ret <<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:17: error: 'strrev' was not declared in this scope; did you mean 'strsep'?
   25 |                 strrev(buf);
      |                 ^~~~~~
      |                 strsep
Language: C++

#include <iostream>
#include <vector>
#include <cstdio>
using namespace std;
int main(){
	string s;
	while(cin>>s){
		vector<int> v;
		int ans=-1;int f=0;
		for(int i=s.size()-1,frag=0;i>-1;--i){
			if(s[i]=='X'||('0'<=s[i]&&s[i]<='9')){
				++frag;
				if(s[i]=='X'){
					v.push_back(i);
					if(i==0&&frag>=2)f=1;
				}dd
			}
			else if(s[i]=='+'||s[i]=='='){
				if(frag>=2)f=1;
				frag=0;
			}else frag=0;
		}
		for(int i=f,a,b,c;i<10;++i){
			for(int j=0;j<v.size();++j){
				s[v[j]]=i+'0';
			}
			sscanf(s.c_str(),"%d+%d=%d",&a,&b,&c);
			if(a+b==c)ans=i;
		}
		if(ans!=-1) cout<<ans<<"\n";
		else cout<<"NA\n";
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:34: error: 'dd' was not declared in this scope
   16 |                                 }dd
      |                                  ^~
Language: C++

#include <iostream>
#include <cstring>
#include <ctype>

int main()
{
	const int N = 128;
	char str[N];
	
	while (std::cin >> str) {
		int cs[N] = {0}, vs[N] = {0};
		int sFlag = 1, cDigit = 0, maxDigit = 0;;
		
		for (int i = strlen(str) - 1; i >= 0; --i) {
			if (isdigit(str[i])) {
				cs[cDigit] += sFlag * (str[i] - '0');
				if (cs[cDigit] < -9 || 9 < cs[cDigit]) {
					cs[cDigit] %= 10;
					cs[cDigit + 1] += sFlag;
				}
				++cDigit;
			} else {
				switch (str[i]) {
				case '=':
					sFlag = -1;
				case '+':
					if (cDigit > maxDigit) maxDigit = cDigit;
					cDigit = 0;
					break;
				case 'X':
					vs[cDigit++] -= sFlag;
					break;
				default:
					break;
				}
			}
		}
		
		int b;
		for (b = 0; vs[b] == 0; ++b);
		
		int ans = cs[b] / vs[b];
		
		if (ans != 0 || vs[maxDigit - 1] == 0) {
			for (int i = 0; i < maxDigit; ++i) {
				if (cs[i] != vs[i] * ans) {
					ans = -1;
					break;
				}
			}
		} else {
			ans = -1;
		}
		
		if (ans == -1) {
			std::cout << "NA";
		} else {
			std::cout << ans;
		}
		std::cout << std::endl;
	}
	
	return 0;
}

Compiler output:
a.cc:3:10: fatal error: ctype: No such file or directory
    3 | #include <ctype>
      |          ^~~~~~~
compilation terminated.
Language: C++

import java.util.*;
import java.math.*;

public class Main {
    public static void main(String[] args) {
        new Main().run();
    }

    void run() {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()) {
            String line = sc.nextLine();
            int plusPos = line.indexOf('+');
            int equalPos = line.indexOf('=');
            String leftOp = line.substring(0, plusPos);
            String rightOp = line.substring(plusPos + 1, equalPos);
            String answerOp = line.substring(equalPos + 1);
            int res = -1;
            for(int i = 0; i <= 9; i++) {
                BigInteger l = new BigInteger(leftOp.replace("X", Integer.toString(i)));
                BigInteger r = new BigInteger(rightOp.replace("X", Integer.toString(i)));
                BigInteger a = new BigInteger(answerOp.replace("X", Integer.toString(i)));
                if(a.equals(l.add(r))) res = i;
            }
            if(res == -1) System.out.println("NA");
            else System.out.println(res);
        }
    }

    void tr(Object... o) {
        System.err.println(Arrays.deepToString(o));
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.math.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: expected unqualified-id before 'public'
    4 | public class Main {
      | ^~~~~~
Language: C++

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

using namespace std;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef long long ll;
typedef unsigned uint;
typedef unsigned long ul;
typedef unsigned long long ull;

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

bool check(int n, string s){
    rep(i, s.size()){
        if (s[i] == 'X') s[i] = n + '0';
    }
    auto iplus = s.find('+');
    auto ieq = s.find('=');
    vs ss(3);
    ss[0] = s.substr(0, iplus);
    ss[1] = s.substr(iplus + 1, ieq - iplus - 1);
    ss[2] = s.substr(ieq + 1);
    rep(i, 3){
        if (ss[i].size() != 1 && ss[i][0] == '0') return false;
    }

    rep(i, 3){
        reverse(all(ss[i]));
        ss[i].resize(ss[2].size(),'0');
    }
    int carry = 0;
    rep(i, ss[2].size()){
        if ((ss[0][i] + ss[1][i] - 2 * '0' + carry)%10 == ss[2][i] - '0'){
            carry = ss[0][i] + ss[1][i] - 2 * '0' + carry >= 10;
        }
        else {
            return false;
        }
    }
    return true;
}

int main(){
    string s;
    while (cin >> s){
        int ans = -1;
        rep(i, 10){
            if (check(i, s)){
                ans = i;
                break;
            }
        }
        if (ans == -1) cout << "NA";
        else cout << ans;
        cout << endl;
    }
}

Compiler output:
a.cc: In function 'bool check(int, std::string)':
a.cc:34:9: error: 'reverse' was not declared in this scope
   34 |         reverse(all(ss[i]));
      |         ^~~~~~~
Language: Java

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

//Doctor's Memorable Codes
public class AOJ0111 {

	public static void main(String[] args) {
		Map<String, Character> t = new HashMap<String, Character>();
		t.put("101", ' ');
		t.put("000000", '\'');
		t.put("000011", ',');
		t.put("10010001", '-');
		t.put("010001", '.');
		t.put("000001", '?');
		t.put("100101", 'A');
		t.put("10011010", 'B');
		t.put("0101", 'C');
		t.put("0001", 'D');
		t.put("110", 'E');
		t.put("01001", 'F');
		t.put("10011011", 'G');
		t.put("010000", 'H');
		t.put("0111", 'I');
		t.put("10011000", 'J');
		t.put("0110", 'K');
		t.put("00100", 'L');
		t.put("10011001", 'M');
		t.put("10011110", 'N');
		t.put("00101", 'O');
		t.put("111", 'P');
		t.put("10011111", 'Q');
		t.put("1000", 'R');
		t.put("00110", 'S');
		t.put("00111", 'T');
		t.put("10011100", 'U');
		t.put("10011101", 'V');
		t.put("000010", 'W');
		t.put("10010010", 'X');
		t.put("10010011", 'Y');
		t.put("10010000", 'Z');
		Map<Character, String> r = new HashMap<Character, String>();
		r.put('A', "00000");
		r.put('B', "00001");
		r.put('C', "00010");
		r.put('D', "00011");
		r.put('E', "00100");
		r.put('F', "00101");
		r.put('G', "00110");
		r.put('H', "00111");
		r.put('I', "01000");
		r.put('J', "01001");
		r.put('K', "01010");
		r.put('L', "01011");
		r.put('M', "01100");
		r.put('N', "01101");
		r.put('O', "01110");
		r.put('P', "01111");
		r.put('Q', "10000");
		r.put('R', "10001");
		r.put('S', "10010");
		r.put('T', "10011");
		r.put('U', "10100");
		r.put('V', "10101");
		r.put('W', "10110");
		r.put('X', "10111");
		r.put('Y', "11000");
		r.put('Z', "11001");
		r.put(' ', "11010");
		r.put('.', "11011");
		r.put(',', "11100");
		r.put('-', "11101");
		r.put('\'', "11110");
		r.put('?', "11111");
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			char[] m = sc.nextLine().toCharArray();
			StringBuilder sb = new StringBuilder();
			for(char c:m)sb.append(r.get(c));
			String s = sb.toString();
			sb = new StringBuilder();
			int i=0;
			while(i<s.length()){
				int k;
				for(k=3;i+k<=s.length();k++){
					String sub = s.substring(i,i+k);
					boolean f = false;
					for(String v : t.keySet()){
						if(v.equals(sub)){
							f = true;
							break;
						}
					}
					if(f)break;
				}
				if(i+k>s.length())break;
				sb.append(t.get(s.substring(i,i+k)));
				i+=k;
			}
			System.out.println(sb);
		}
	}
}

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

type Binary = String

main = interact $ unlines.map (readNumLine.concat.map (toBin code_charTable)).lines

toBin :: [(Char,String)] -> Char -> String
toBin list char = case lookup char list of
                    Just b -> b
                    Nothing -> ""

readNumLine :: String -> String
readNumLine (x:xs) = rnl [x] xs

rnl _   []   = []
rnl acc line = case lookup acc char_codeTable of
                 Just c -> c:readNumLine line
                 Nothing -> rnl (acc++[head line]) $ tail line

bin2dec :: Binary -> Int
bin2dec = foldl (\x y -> 2*x +y) 0.map (\x -> read [x])

dec2bin :: Int -> Binary
dec2bin = concat.map show.reverse.i2b
    where i2b 0 = []
          i2b n = mod n 2: i2b (div n 2)

showBin :: Int -> Binary -> String
showBin d n = if length n <= d then replicate (d- length n) '0' ++ n
                               else n

charTable = ['A','B'..'Z'] ++ [' ','.',',','-','\'','?']
codeTable = map (showBin 5.dec2bin) $ [0..31]
code_charTable = zip charTable codeTable
char_codeTable = [("101",' '),("000000",'\''),("000011",','),("10010001",'-')
                 ,("010001",'.'),("000001",'?'),("100101",'A'),("10011010",'B')
                 ,("0101",'C'),("0001",'D'),("110",'E'),("01001",'F'),("10011011",'G')
                 ,("010000",'H'),("0111",'I'),("10011000",'J'),("0110",'K'),("00100",'L')
                 ,("10011001",'M'),("10011110",'N'),("00101",'O'),("111",'P')
                 ,("10011111",'Q'),("1000",'R'),("00110",'S'),("00111",'T'),("10011100",'U')
                 ,("10011101",'V'),("000010",'W'),("10010010",'X'),("10010011",'Y'),("10010000",'Z')]

Compiler output:
a.cc:19:18: error: stray '\' in program
   19 | bin2dec = foldl (\x y -> 2*x +y) 0.map (\x -> read [x])
      |                  ^
a.cc:19:41: error: stray '\' in program
   19 | bin2dec = foldl (\x y -> 2*x +y) 0.map (\x -> read [x])
      |                                         ^
a.cc:31:40: error: too many decimal points in number
   31 | codeTable = map (showBin 5.dec2bin) $ [0..31]
      |                                        ^~~~~
a.cc:1:1: error: 'type' does not name a type; did you mean 'typeof'?
    1 | type Binary = String
      | ^~~~
      | typeof
Language: C++

#! python.exe
dic = {}
for idx, c in enumerate("ABCDEFGHIJKLMNOPQRSTUVWXYZ .,-'?"):
    dic[c] = str(format(idx,'b').zfill(5))

decode = {"101"      : " ", "0101"     : "C", "0110"     : "K", "00110"    : "S",
          "000000"   : "'", "0001"     : "D", "00100"    : "L", "00111"    : "T",
          "000011"   : ",", "110"      : "E", "10011001" : "M", "10011100" : "U",
          "10010001" : "-", "01001"    : "F", "10011110" : "N", "10011101" : "V",
          "010001"   : ".", "10011011" : "G", "00101"    : "O", "000010"   : "W",
          "000001"   : "?", "010000"   : "H", "111"      : "P", "10010010" : "X",
          "100101"   : "A", "0111"     : "I", "10011111" : "Q", "10010011" : "Y",
          "10011010" : "B", "10011000" : "J", "1000"     : "R", "10010000" : "Z"}
#print(dic)
while True:
    try:
        line = input()
    except:
        break
    s = ""
    for c in line:
        s += dic[c]
    ans = ""
    tmp = ""
    for c in s:
        tmp += c
        if tmp in decode:
            ans += decode[tmp]
            tmp = ''
#        print(ans, s)
    print(ans)

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #!
    1 | #! python.exe
      |  ^
a.cc:14:2: error: invalid preprocessing directive #print
   14 | #print(dic)
      |  ^~~~~
a.cc:29:19: error: empty character constant
   29 |             tmp = ''
      |                   ^~
a.cc:30:10: error: invalid preprocessing directive #print
   30 | #        print(ans, s)
      |          ^~~~~
a.cc:2:1: error: 'dic' does not name a type
    2 | dic = {}
      | ^~~
a.cc:3:1: error: expected unqualified-id before 'for'
    3 | for idx, c in enumerate("ABCDEFGHIJKLMNOPQRSTUVWXYZ .,-'?"):
      | ^~~
a.cc:15:1: error: expected unqualified-id before 'while'
   15 | while True:
      | ^~~~~
Language: C++

#include<cstdlib>
#include<string>
using namespace std;
string tbl01[]={
	"101","000000","000011","10010001","010001","000001","100101","10011010",
	"0101","0001","110","01001","10011011","010000","0111","10011000",
	"0110","00100","10011001","10011110","00101","111","10011111","1000",
	"00110","00111","10011100","10011101","000010","10010010","10010011","10010000"
};
string tbl01_idx=" ',-.?ABCDEFGHIJKLMNOPQRSTUVWXYZ";
string str_AB=" .,-'?";

string from01(string s){
	string r;
	for(int i=0;i<s.size();){
		for(int j=0;j<32;j++){
			if(s.substr(i,tbl01[j].size())!=tbl01[j]){
				if(j==31)return r;;
				continue;
			}
			i+=tbl01[j].size();
			r+=tbl01_idx[j];
			break;
		}
	}
}
string fromAB(string &s){
	string r; char t[9],u[9];
	for(int i=0;i<s.size();i++){
		int c=str_AB.find(s[i]);
		if(c==str_AB.npos)c=s[i]-'A';
		else c+=26;
		itoa(c,t,2); sprintf(u,"%05s",t);
		r+=u;
	}
	return r;
}
int main(){
	string s;
	while(getline(cin,s))cout<<from01(fromAB(s))<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'std::string fromAB(std::string&)':
a.cc:33:17: error: 'itoa' was not declared in this scope
   33 |                 itoa(c,t,2); sprintf(u,"%05s",t);
      |                 ^~~~
a.cc: In function 'int main()':
a.cc:40:23: error: 'cin' was not declared in this scope
   40 |         while(getline(cin,s))cout<<from01(fromAB(s))<<endl;
      |                       ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include<string>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:40:30: error: 'cout' was not declared in this scope
   40 |         while(getline(cin,s))cout<<from01(fromAB(s))<<endl;
      |                              ^~~~
a.cc:40:30: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:40:55: error: 'endl' was not declared in this scope
   40 |         while(getline(cin,s))cout<<from01(fromAB(s))<<endl;
      |                                                       ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include<string>
  +++ |+#include <ostream>
    3 | using namespace std;
a.cc: In function 'std::string from01(std::string)':
a.cc:26:1: warning: control reaches end of non-void function [-Wreturn-type]
   26 | }
      | ^
Language: C++

#include<cstdlib>
#include<cstring>
#include<string>
using namespace std;

void itoa0(int value, char *buff ,int tmp){
	char *p;
	int mod;
	p = buff;
	do{
		mod = value % tmp + 48;
		*p++ = (char)mod;
		value /= tmp;
	}while(value);
	*p = '\0';
	strrev(buff);
}

string tbl01[]={
	"101","000000","000011","10010001","010001","000001","100101","10011010",
	"0101","0001","110","01001","10011011","010000","0111","10011000",
	"0110","00100","10011001","10011110","00101","111","10011111","1000",
	"00110","00111","10011100","10011101","000010","10010010","10010011","10010000"
};
string tbl01_idx=" ',-.?ABCDEFGHIJKLMNOPQRSTUVWXYZ";
string str_AB=" .,-'?";

string from01(string s){
	string r;
	for(int i=0;i<s.size();){
		for(int j=0;j<32;j++){
			if(s.substr(i,tbl01[j].size())!=tbl01[j]){
				if(j==31)return r;;
				continue;
			}
			i+=tbl01[j].size();
			r+=tbl01_idx[j];
			break;
		}
	}
}
string fromAB(string &s){
	string r; char t[9],u[9];
	for(int i=0;i<s.size();i++){
		int c=str_AB.find(s[i]);
		if(c==str_AB.npos)c=s[i]-'A';
		else c+=26;
		itoa0(c,t,2); sprintf(u,"%05s",t);
		r+=u;
	}
	return r;
}
int main(){
	string s;
	while(getline(cin,s))cout<<from01(fromAB(s))<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'void itoa0(int, char*, int)':
a.cc:16:9: error: 'strrev' was not declared in this scope; did you mean 'strsep'?
   16 |         strrev(buff);
      |         ^~~~~~
      |         strsep
a.cc: In function 'int main()':
a.cc:55:23: error: 'cin' was not declared in this scope
   55 |         while(getline(cin,s))cout<<from01(fromAB(s))<<endl;
      |                       ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include<string>
  +++ |+#include <iostream>
    4 | using namespace std;
a.cc:55:30: error: 'cout' was not declared in this scope
   55 |         while(getline(cin,s))cout<<from01(fromAB(s))<<endl;
      |                              ^~~~
a.cc:55:30: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:55:55: error: 'endl' was not declared in this scope
   55 |         while(getline(cin,s))cout<<from01(fromAB(s))<<endl;
      |                                                       ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include<string>
  +++ |+#include <ostream>
    4 | using namespace std;
a.cc: In function 'std::string from01(std::string)':
a.cc:41:1: warning: control reaches end of non-void function [-Wreturn-type]
   41 | }
      | ^
Language: C++

#include <string>
#include <bitset>
#include <map>
#include <cstring>
#include <windows.h>
using namespace std;

const char *t1=" ',-.?ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const char *v1[]={"101","000000","000011","10010001","010001","000001","100101","10011010","0101","0001","110","01001","10011011","010000","0111","10011000","0110","00100","10011001","10011110","00101","111","10011111","1000","00110","00111","10011100","10011101","000010","10010010","10010011","10010000"};
const char *t2="ABCDEFGHIJKLMNOPQRSTUVWXYZ .,-'?";

int main(){
  string s,t,z;
  int i,j;
  map<string,char>m;
  for(i=0;i<32;i++)m[string(v1[i])]=t1[i];
  for(;z=t="",getline(cin,s);cout<<t<<endl){
    for(i=0;i<s.size();i++)
      if((j=strchr(t2,s[i])-t2)+t2)z+=bitset<5>(j).to_string();
    for(i=0;;i+=j){
      for(j=1;i+j<=z.size();j++)
        if(m[z.substr(i,j)]){t+=m[z.substr(i,j)];break;}
      if(i+j>z.size())break;
    }
  }
}

Compiler output:
a.cc:5:10: fatal error: windows.h: No such file or directory
    5 | #include <windows.h>
      |          ^~~~~~~~~~~
compilation terminated.
Language: C++

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

using namespace std;

int main(){

	map<string,char> table;
	table["101"]=' ';
	table["000000"]=(char)39;
	table["000011"]=',';
	table["10010001"]='-';
	table["010001"]='.';
	table["000001"]='?';
	table["100101"]='A';
	table["10011010"]='B';
	table["0101"]='C';
	table["0001"]='D';
	table["110"]='E';
	table["01001"]='F';
	table["10011011"]='G';
	table["010000"]='H';
	table["0111"]='I';
	table["10011000"]='J';
	table["0110"]='K';
	table["00100"]='L';
	table["10011001"]='M';
	table["10011110"]='N';
	table["00101"]='O';
	table["111"]='P';
	table["10011111"]='Q';
	table["1000"]='R';
	table["00110"]='S';
	table["00111"]='T';
	table["10011100"]='U';
	table["10011101"]='V';
	table["000010"]='W';
	table["10010010"]='X';
	table["10010011"]='Y';
	table["10010000"]='Z';

	// \
	map<char,string> table2;
	for(int i = 0; i < 26; i++){
		string ms;
		for(int j = 0; j < 5; j++){
			if((i>>j)&1){
				ms+='1';
			}
			else
				ms+='0';
		}
		reverse(ms.begin(),ms.end());
		table2['A'+i]=ms;
	}
	table2[' ']="11010";
	table2['.']="11011";
	table2[',']="11100";
	table2['-']="11101";
	table2[(char)39]="11110";
	table2['?']="11111";


	string str;
	while(getline(cin,str)){
		// ¶ð»
		string nstr;
		for(int i = 0; i < str.size(); i++){
			nstr+=(table2[str[i]]);
		}
		//¡
		string dstr;
		for(int i = 0; i < nstr.size(); i++){
			for(map<string,char>::iterator it = table.begin(); it !=table.end(); it++){
				string s=it->first;
				if(i+s.size()-1<nstr.size()){
					string ss=nstr.substr(i,s.size());
					if(it->first==ss){
						dstr+=it->second;
						i+=s.size()-1;
						break;
					}
				}
			}
		}
		cout<<dstr<<endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:58:17: error: 'table2' was not declared in this scope; did you mean 'table'?
   58 |                 table2['A'+i]=ms;
      |                 ^~~~~~
      |                 table
a.cc:60:9: error: 'table2' was not declared in this scope; did you mean 'table'?
   60 |         table2[' ']="11010";
      |         ^~~~~~
      |         table
Language: C++

#include "iostream"
#include "map"
#include "string"
using namespace std;

map< char, string > toBits;
map< string, char > toChar;

#define INSB( k, s ) (toBits.insert( map<char, string>::value_type(k, s)))
#define INSC( k, s ) (toChar.insert( map<string, char>::value_type(k, s))) 

string ToBits( char ch ) {
	string res = "", tmp = "";
	int num = ch - 'A';

	for( int i = 0; i < 5; ++i ) {
		tmp += (char)((num % 2) + '0' );
		num /= 2;
	}

	for( int i = 4; i >= 0; --i ) {
		res += tmp[ i ];
	}

	return res;
}

void Init() {
	// toBitsの初期化
	INSB( ' ', "11010" ); INSB( '.', "11011" ); INSB( ',', "11100" );
	INSB( '-', "11101" ); INSB( '\'', "11110" ); INSB( '?', "11111" );
	for( char c = 'A'; c <= 'Z'; ++c ) {
		INSB( c, ToBits( c ) );
	}

	// toCharの初期化
	INSC( "101", ' ' );      INSC( "000000", '\'' );  INSC( "000011", ',' );
	INSC( "10010001", '-' ); INSC( "010001", '.' );   INSC( "000001", '?' );
	INSC( "100101", 'A' );   INSC( "10011010", 'B' ); INSC( "0101", 'C' );
	INSC( "0001", 'D' );     INSC( "110", 'E' );      INSC( "01001", 'F' );
	INSC( "10011011", 'G' ); INSC( "010000", 'H' );   INSC( "0111", 'I' );
	INSC( "10011000", 'J' ); INSC( "0110", 'K' );     INSC( "00100", 'L' );
	INSC( "10011001", 'M' ); INSC( "10011110", 'N' ); INSC( "00101", 'O' );
	INSC( "111", 'P' );      INSC( "10011111", 'O' ); INSC( "1000", 'R' );
	INSC( "00110", 'S' );    INSC( "00111", 'T' );    INSC( "10011100", 'U' );
	INSC( "10011101", 'V' ); INSC( "000010", 'W' );   INSC( "10010010", 'X' );
	INSC( "10010011", 'Y' ); INSC( "10010000", 'Z' );
}

int _tmain(int argc, _TCHAR* argv[])
{
	Init();

	string in;
	while( getline( cin, in ) ) {
		string bits = "";
		string tmp = "";

		for( int i = 0; i < in.length(); ++i ) {
			bits += toBits[ in[ i ] ];
		}

		for( int i = 0; i < bits.length(); ++i ) {
			tmp += bits[ i ];
			if( toChar.find( tmp ) != toChar.end() ) {
				cout << toChar[ tmp ];
				tmp = "";
			}
		}
		cout << endl;
	}
	return 0;
}

Compiler output:
a.cc:50:22: error: '_TCHAR' has not been declared
   50 | int _tmain(int argc, _TCHAR* argv[])
      |                      ^~~~~~
Language: Java

import java.util.Arrays;
import java.util.Scanner;


public class AMilkShop {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		while(true){
			int cnt = s.nextInt();
			if(cnt==0)
				return;
			int[] times = new int[cnt];
			for(int i=0 ; i<cnt ; i++) {
				times[i] = s.nextInt();
			}
			Arrays.sort(times);
			solve(times);
		}
	}

	public static void solve(int[] times) {
		int sumWaitTime = 0;
		int waitT = 0;
		for(int i=0 ; i<times.length-1 ; i++) {
			waitT += times[i];
			sumWaitTime += waitT;
		}
		System.out.println(sumWaitTime);
	}
}

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

mport java.util.Scanner;
import java.util.Collections;
import java.util.ArrayList;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int n = sc.nextInt();
			if (n == 0)
				break;
			ArrayList<Integer> list = new ArrayList<Integer>();
			for (int i = 0; i < n; i++) {
				list.add(sc.nextInt());
			}
			Collections.sort(list);
			long[] a = new long[n];
			long ans = 0;
			long v = list.get(0);
			a[0] = 0;
			for (int i = 1; i < n; i++) {
				a[i] = v;
				v += list.get(i);
				ans += a[i];
			}
			System.out.println(ans);
		}
	}
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.Scanner;
^
Main.java:2: error: class, interface, enum, or record expected
import java.util.Collections;
^
Main.java:3: error: class, interface, enum, or record expected
import java.util.ArrayList;
^
3 errors