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

import java.io.IOException;
import java.util.Scanner;

public class Water {

	public static void main(String[] args) throws IOException{
		
		while(true){
		int num=0;
		int[] cc= new int[5];
		int n, m, s, g1, g2;
		
		Scanner sc = new Scanner(System.in);
		while(num<5){
			cc[num]=sc.nextInt();
			num++;
        }
		n=cc[0];
		m=cc[1];
		s=cc[2];
		g1=cc[3];
		g2=cc[4];
		
		if(n==0 && m==0){
			if(s==0 && g1==0){
				if(g2==0){break;}
			}
		}
		
		int[][] road= new int[n][n];
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				road[i][j]=10000;
			}
		}
		

		num=0;
		while(num<m){
			int i=sc.nextInt();
			int j=sc.nextInt();
			int cost=sc.nextInt();
			road[i-1][j-1]=cost;
			road[j-1][i-1]=cost;
			num++;
		}

		for(int k=0;k<n;k++){
			for(int i=0;i<n;i++){
				for(int j=0;j<n;j++){
					if(road[i][j]>road[i][k]+road[k][j]){
						road[i][j]=road[i][k]+road[k][j];
					}
				}
			}
		}
		int r=road[0][s-1]+road[0][g1-1]+road[0][g2-1];
		for(int k=0;k<n;k++){
			if(r>road[k][s-1]+road[k][g1-1]+road[k][g2-1]){
				r=road[k][s-1]+road[k][g1-1]+road[k][g2-1];
			}
		}
		System.out.println(r);
		}
	}

}

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

import java.util.Scanner;


public class WaterPipeConstruction {
	
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		
		while(true){
			
			int n = sc.nextInt();
			int m = sc.nextInt();
			int s = sc.nextInt();
			int g1 = sc.nextInt();
			int g2 = sc.nextInt();
			
			if(n == 0 && m == 0 && s == 0 && g1 == 0 && g2 == 0){
				break;
			}
			
			int[][] street = new int[n + 1][n + 1];
			int x;
			int y;
			int cost;
			
			for(int i = 1; i < n + 1; i++){
				for(int j = 1; j < n + 1; j++){
					street[j][i] = Integer.MAX_VALUE/10;
				}
			}
			
			for(int i = 0; i < m ; i++){
				x = sc.nextInt();
				y = sc.nextInt();
				cost = sc.nextInt();
				street[x][y] = cost;
				street[y][x] = cost;
				
			}
			
			for(int i = 1; i < n + 1; i++){
				street[i][i] = 0;
				for(int j = 1; j < n + 1; j++){
					for(int k = 1; k < n + 1; k++){
						street[j][k] = Math.min(street[j][k], street[j][i] + street[i][k]);
					}
				}
			}
			int route[] = new int[3];
			route[0] = street[g2][g1];
			route[1] = street[s][g1];
			route[2] = street[s][g2];
			int sum = Integer.MAX_VALUE;
			for(int i = 0; i < 3; i++){
				for(int j = 0; j < 3; j++){
					if(i != 1 && 2 != 0){
						sum = Math.min(sum, route[i] + route[j]);
					}
				}
			}
			System.out.println(sum);
			
		}
		
	}

}

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

import java.util.Scanner;

public class Water_Pipe {
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int m = sc.nextInt();
		int start = sc.nextInt();
		start = start - 1;
		int goal1 = sc.nextInt();
		goal1 = goal1 - 1;
		int goal2 = sc.nextInt();
		goal2 = goal2 - 1;
		int road[][] = new int[N][N];
		for(int i = 0; i < N; i++)
		{
			for(int j = 0; j < N; j++)
			{
				road[i][j] = Integer.MAX_VALUE / 10;
			}
		}
		for(int i = 0; i < m;i++)
		{
			int j = sc.nextInt();
			int k = sc.nextInt();
			road[j-1][k-1] = sc.nextInt();
		}
		for(int i = 0; i < N; i++)
		{
			road[i][i] = 0;
		}

			for(int k = 0; k < N; k++)
			{
				for(int i = 0 ; i < N; i++)
				{
					for(int j = 0; j < N;j++)
					{
						int num = road[i][k] + road[k][j];
						road[i][j] = min(road[i][j],num);
					}
				}
			}
			
		int min = 0;
		min = road[start][goal1] + road[start][goal2];
		for(int i = 0; i < N; i++)
		{
			int min_road = min(road[start][i] + road[i][goal1],road[start][i] + road[i][goal2]);
			min_road = min_road + road[goal1][goal2];
			if(min > min_road)min = min(min,road[start][i] + min_road);
		}
		for(int i = 0; i < N; i++)
		{
			int min_road = road[start][i] + road[i][goal1] + road[i][goal2];
			if(min > min_road)min = min_road;
		}
		System.out.println(min);
	}

	private static int min(int i, int j) {
		if(i < j) return i;
		else return j;
	}
	
	private static int max(int i , int j)
	{
		if(i < j) return j;
		else return i;
	}
}

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

#include <iostream>
#include <algorithm>
using namespace std;
int G[100][100];
int n;

int solve(int s,int g1,int g2){
  for(int k=0;k<n;++k)
    for(int i=0;i<n;++i)
      for(int j=0;j<n;++j)
	G[i][j] = min(G[i][j],G[i][k]+G[k][j]);

  int ret = INF;
  for(int t=0;t<n;++t)
    ret = min(ret,G[s][t]+G[t][g1]+G[t][g2]);
  return ret;
}

int main(){
  int m,s,g1,g2;
  while(cin>>n>>m>>s>>g1>>g2,n){
    for(int i=0;i<n;++i)
      for(int j=0;j<n;++j)
	G[i][j] = 1<<29;
    s--;g1--;g2--;
    while(m--){
      int a,b,c;
      cin >> a >> b >> c;
      a--;b--;
      G[a][b] = c;
    }
    cout << solve(s,g1,g2) << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int solve(int, int, int)':
a.cc:13:13: error: 'INF' was not declared in this scope
   13 |   int ret = INF;
      |             ^~~
Language: C++

#include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__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 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((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

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

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

struct {

};
int main() {
	int n, m, s, g1, g2;
	while (cin >> n >> m >> s >> g1 >> g2, n){
		vector<vector<int>> load(n + 1, vector<int>(n + 1, 1000000000));//from back to 
		REP(i, m){
			int b1, b2, c;
			cin >> b1 >> b2 >> c;
			load[b1][b2] = c;
			load[b2][b1] = c;
		}
		FOR(i, 1, n + 1){
			FOR(j, 1, n + 1){
				FOR(k, 1, n + 1){
					load[j][k] = min(load[j][k], load[j][i] + load[i][k]);
				}
			}
		}
		int ans = 1000000000;
		FOR(i, 1, n + 1){
			ans = min(ans,load[s][i]+load[i][g1]+load[i][g2]);
		}
		cout << ans << endl;
	}
}

Compiler output:
a.cc:48:1: error: abstract declarator '<unnamed struct>' used as declaration
   48 | };
      | ^
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include <functional>
#define INF 1000000
using namespace std;
typedef long long ll;
struct edge { int to, cost; };
typedef pair<ll, int> P;


int V;
vector<edge> G[1010];
ll d[105];

ll dijkstra(int s,int g) {
	priority_queue<P, vector<P>,greater<P>> que;
	fill(d, d + V, 1000000);
	d[s] = 0;
	que.push(P(0, s));

	while (!(que.empty())) {
		P p = que.top(); que.pop();
		int v = p.second;
		if (d[v] < p.first)continue;
		for (int i = 0; i < G[v].size; i++) {
			edge e = G[v][i];
			if (d[e.to] > d[v] + e.cost) {
				d[e.to] = d[v] + e.cost;
				que.push(P(d[e.to], e.to));
			}
		}
	}
	return d[g];
}

int main() {
	while (true) {
		int n, m, s, g1, g2, a, b, c;
		ll ans;
		cin >> n >> m >> s >> g1 >> g2;
		if (n == 0)break;
		s--; g1--; g2--;
		for (int i = 0; i < m; i++) {
			cin >> a >> b >> c;
			edge e;
			e.to = b - 1; e.cost = c;
			G[a - 1].push_back(e);
		}
		ans = min(dijkstra(s, g1)+dijkstra(g1,g2),dijkstra(s,g2)+dijkstra(g2,g1));
		cout << ans << endl;
		for (int i = 0; i < n; i++) {
			G[i].clear();
		}
	}
}

Compiler output:
a.cc: In function 'll dijkstra(int, int)':
a.cc:27:42: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = edge; _Alloc = std::allocator<edge>; size_type = long unsigned int]' (did you forget the '()' ?)
   27 |                 for (int i = 0; i < G[v].size; i++) {
      |                                     ~~~~~^~~~
      |                                              ()
Language: C++

#include <iostream>
#include <utility>
#include <vector>
#include <queue>
#include <functional>
#include <cassert>

using namespace std;

const int INF = 1e9 + 10;


class Dijkstra {
#define MAX_V 101
  typedef pair<int, int> P;

private:
  struct Edge {
    int to, cost;
    Edge(int to, int cost): to(to), cost(cost) { }
  };

  int V;
  vector<Edge> G[MAX_V];
  int prev[MAX_V];

public:

  Dijkstra(int V): V(V) { 
    if (V >= MAX_V) {
      assert(false);
    }
  }

  void AddEdge(int from, int to, int cost) {
    G[from].push_back(Edge(to, cost));
  }

  vector<int> Solve(int s) {
    priority_queue<P, vector<P>, greater<P>> que;
    vector<int> d(V, INF);
    d[s] = 0;
    que.push(P(0, s));
    fill(prev, prev + V, -1);

    while (!que.empty()) {
      P p = que.top(); que.pop();
      int v = p.second;
      if (d[v] < p.first) {
        continue;
      }
      for (int i = 0; i < G[v].size(); i++) {
        Edge e = G[v][i];
        if (d[e.to] > d[v] + e.cost) {
          d[e.to] = d[v] + e.cost;
          que.push(P(d[e.to], e.to));
          prev[e.to] = v;
        }
      }
    }

    return d;
  }

  vector<int> GetPath(int t) {
    vector<int> path;
    for (; t != -1; t = prev[t]) {
      path.push_back(t);
    }
    reverse(path.begin(), path.end());
    return path;
  }
};

int main() {
  while (true) {
    int n, m, s, g1, g2;
    cin >> n >> m >> s >> g1 >> g2;
    if (n + m + s + g1 + g2 == 0) {
      break;
    }
    s--; g1--; g2--;
    Dijkstra dijkstra(n);
    for (int i = 0; i < m; i++) {
      int b1, b2, c;
      cin >> b1 >> b2 >> c;
      b1--; b2--;
      dijkstra.AddEdge(b1, b2, c);
      dijkstra.AddEdge(b2, b1, c);
    }


    int ans = INF;
    for (int i = 0; i < n; i++) {
      vector<int> d = dijkstra.Solve(i);
      ans = min(ans, d[s] + d[g1] + d[g2]);
    }
    cout << ans << endl;
  }

  return 0;
}

Compiler output:
a.cc: In member function 'std::vector<int> Dijkstra::GetPath(int)':
a.cc:70:5: error: 'reverse' was not declared in this scope
   70 |     reverse(path.begin(), path.end());
      |     ^~~~~~~
Language: C++

#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
#define INF 1e7
using namespace std;
int main(){
  int n,m,x,y,z,q,w,e;
  while(cin>>n>>m>>x>>y>>z,n++){
    int dp[n][n]={};
    r(i,n)r(j,n)if(i!=j)dp[i][j]=INF;
    r(i,m){
      cin>>q>>w>>e;
      dp[q][w]]=e;
    }
    r(o,n)r(i,n)r(j,n)dp[i][j]=min(dp[i][j],dp[i][o]+dp[o][j]);
    int ans=INF;
    r(i,n)ans=min(ans,dp[i][x]+dp[i][y]+dp[i][z]);
    cout<<ans<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: expected ';' before ']' token
   12 |       dp[q][w]]=e;
      |               ^
      |               ;
Language: C++

#include<iostream> using namespace std; int main() { int n,m,s,g1,g2,a,b,cost,mi; int map[101][101]; while(1){ cin>>n>>m>>s>>g1>>g2; if(n==0 && m==0 && s==0 && g1==0 && g2==0)break; for(int i=0;i<n+1;i++){ for(int j=0;j<n+1;j++){ if(i==j)map[i][j]=0; else map[i][j]=1000000; } } for(int i=0;i<m;i++){ cin>>a>>b>>cost; map[a-1][b-1]=cost; } for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ for(int k=0;k<n;k++){ map[j][k]=min(map[j][k],map[j][i]+map[i][k]); } } } mi=1000000; for(int i=0;i<n;i++)mi=min(mi,map[s-1][i]+map[i][g1-1]+map[i][g2-1]); cout<<mi<<endl; } return 0; }


Compiler output:
a.cc:1:20: warning: extra tokens at end of #include directive
    1 | #include<iostream> using namespace std; int main() { int n,m,s,g1,g2,a,b,cost,mi; int map[101][101]; while(1){ cin>>n>>m>>s>>g1>>g2; if(n==0 && m==0 && s==0 && g1==0 && g2==0)break; for(int i=0;i<n+1;i++){ for(int j=0;j<n+1;j++){ if(i==j)map[i][j]=0; else map[i][j]=1000000; } } for(int i=0;i<m;i++){ cin>>a>>b>>cost; map[a-1][b-1]=cost; } for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ for(int k=0;k<n;k++){ map[j][k]=min(map[j][k],map[j][i]+map[i][k]); } } } mi=1000000; for(int i=0;i<n;i++)mi=min(mi,map[s-1][i]+map[i][g1-1]+map[i][g2-1]); cout<<mi<<endl; } return 0; }
      |                    ^~~~~
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
using namespace std;
#define MAX (1<<21)


int d[121][121];
void reset(int n){
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      d[i][j]=MAX;
    }
    d[i][i]=0;
  }
}

void warshall_floyd(int n){
  for(int k=1;k<n;k++){
    for(int i=1;i<n;i++){
      for(int j=1;j<n;j++){
        //if (d[i][k] == MAX || d[k][j]==MAX)continue;
        d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
      }
    }
  }
}

main(){
  int n,m,s,g1,g2;
  while(cin >> n>>m>>s>>g1>>g2){
    if (n==0)break;
    reset(n+1);
    for(int i=0;i<m;i++){
      int from,to,cost;
      cin >> from >> to >> cost;
      d[from][to]=cost;
    }
    
    warshall_floyd(n+1);
    int min = INT_MAX;
    for(int i=1;i<n+1;i++){
      int cost = d[s][i]+d[i][g1]+d[i][g2];
      if (cost< min)min=cost;
    }
    cout << min << endl;
  }
}

Compiler output:
a.cc:27:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   27 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:39:15: error: 'INT_MAX' was not declared in this scope
   39 |     int min = INT_MAX;
      |               ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include<iostream>
  +++ |+#include <climits>
    2 | using namespace std;
Language: C++

#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>

using namespace std;

inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str();}

typedef vector<int> vi;
typedef vector<vi>  vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;

#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EACH(t,i,c) for(t::iretator i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

const double EPS = 1e-10;


int main() {
	int n, m, s, g1, g2;
	int b1, b2, c;
	int k, i, j;
	int minCost;

	vvi cost;

	while((cin >> n >> m >> s >> g1 >> g2) && n!=0) {

	cost.resize(n);
	
	REP(i, n) {
		cost[i].resize(n);
	}

	REP(i, n) {
		REP(j, n) {A
			cost[i][j] = 1000000;
		}
	}

	REP(i, m) {
		cin >> b1 >> b2 >> c;

		cost[b1-1][b2-1] = c;
	}

	REP(k, n) {
		REP(i, n) {
			REP(j, n) {
				cost[i][j] = min(cost[i][j], cost[i][k] + cost[k][j]);
			}
		}
	}

	minCost = cost[s-1][g1-1] + cost[s-1][g2-1];
	k = max(g1, g2);

	FOR(i, s-1, k) {
		minCost = min(minCost, cost[s-1][i] + cost[i][g1-1] + cost[i][g2-1]);
	}

	cout << minCost << endl;

	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:28: error: 'A' was not declared in this scope
   59 |                 REP(j, n) {A
      |                            ^
Language: C++

#include <cstdio>

using namespace std;

#define MAX_N 101
#define INF (1<<28)

int n, m, s, g1, g2;
int graph[MAX_N][MAX_N];
int main() {
    while (scanf("%d %d %d %d %d", &n, &m, &s, &g1, &g2), n || m || s || g1 || g2) {
        for (int i = 0; i <= n; i++) for (int j = 0; j <= n; j++) graph[i][j] = INF;
        for (int i = 0; i < m; i++) {
            int b1, b2, c;
            scanf("%d %d %d", &b1, &b2, &c);
            graph[b1][b2] = c;
        }
        for (int k = 1; k <= n; k++) {
            for (int i = 1; i <= n; i++) {
                for (int j = 1; j <= n; j++) {
                    graph[i][j] = min(graph[i][j], graph[i][k] + graph[k][j]);
                }
            }
        }

        int min_cost = graph[s][g1] + graph[s][g2];
        for (int i = 1; i <= n; i++) { // 分岐する点
            min_cost = min(min_cost, graph[s][i] + graph[i][g1] + graph[i][g2]);
        }
        printf("%d\n", min_cost);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:35: error: 'min' was not declared in this scope; did you mean 'main'?
   21 |                     graph[i][j] = min(graph[i][j], graph[i][k] + graph[k][j]);
      |                                   ^~~
      |                                   main
a.cc:28:24: error: 'min' was not declared in this scope; did you mean 'main'?
   28 |             min_cost = min(min_cost, graph[s][i] + graph[i][g1] + graph[i][g2]);
      |                        ^~~
      |                        main
Language: C++

#include <cstdio>
#include <algorithm>
#define INF 999999999

using namespace std;

int n, d[101][101];

void warshall_floyd(void){

  for( int k = 1; k <= n; k++ )
    for( int i = 1; i <= n; i++ )
      for( int j = 1; j <= n; j++ ){
	d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
      }
}

 
int main(void){

    int m, s, g1, g2, b1, b2, c;

    while(cin >> n >> m >> s >> g1 >> g2 ){
      if( n == m && m == s && s == g1 && g1 == g2 && g2 == 0 ) break;

        for( int i = 0; i <= n; i++ ){
            for(int j = 0; j <= n; ++j){
                d[i][j] = INF;
            }
            d[i][i] = 0;
        }
         
        for( int i = 0; i < m; i++ ){
	  cin >> b1 >> b2 >> c;
            d[b1][b2] = c;
        }
                  
        int ans = INF;
        for( int i = 1; i <= n; i++ ){
            ans = min(ans, d[s][i] + d[i][g1] + d[i][g2]);
        }
	cout << ans << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:11: error: 'cin' was not declared in this scope
   23 |     while(cin >> n >> m >> s >> g1 >> g2 ){
      |           ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <algorithm>
  +++ |+#include <iostream>
    3 | #define INF 999999999
a.cc:42:9: error: 'cout' was not declared in this scope
   42 |         cout << ans << endl;
      |         ^~~~
a.cc:42:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:42:24: error: 'endl' was not declared in this scope
   42 |         cout << ans << endl;
      |                        ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include <algorithm>
  +++ |+#include <ostream>
    3 | #define INF 999999999
Language: Java

import java.io.IOException;
import java.util.Scanner;

public class KeitaiMessage {

  public static void main(String[] args) throws IOException {
    Scanner sc = new Scanner(System.in);
    String raw;
    char ch[] = new char[1024];
    int times = sc.nextInt();
    sc.nextLine();

    for (int i = 0; i < times; i++) {
      int cnt = 0;
      raw = sc.nextLine();

      for (int j = 0; j < raw.length(); j++) {
        ch[j] = raw.charAt(j);
      }

      for (int j = 0; j < raw.length(); j++) {
        try {
          if (ch[j] == '0' && ch[j - 1] != '0') {
            chooseLiteral(ch[j - 1], cnt);
            cnt = 0;
          } else if (ch[j] == '0') {
          } else {
            cnt++;
          }
        } catch (ArrayIndexOutOfBoundsException e) {
        }
      }
      System.out.println();
    }

    sc.close();
    System.exit(0);
  }

  public static void chooseLiteral(char c, int times) {
    switch (c) {
    case '1':
      times %= 5;

      switch (times) {
      case 1:
        System.out.println('.');
        break;

      case 2:
        System.out.print(',');
        break;

      case 3:
        System.out.print('!');
        break;

      case 4:
        System.out.print('?');
        break;

      case 0:
        System.out.print(' ');
        break;

      default:
        System.out.println("there is exist a bug");
      }
      break;

    case '2':
      printMes('a', times, 3);
      break;

    case '3':
      printMes('d', times, 3);
      break;

    case '4':
      printMes('g', times, 3);
      break;

    case '5':
      printMes('j', times, 3);
      break;

    case '6':
      printMes('m', times, 3);
      break;

    case '7':
      printMes('p', times, 4);
      break;

    case '8':
      printMes('t', times, 3);
      break;

    case '9':
      printMes('w', times, 3);
      break;

    default:
      System.out.println("there is exist a bug");
    }
  }

  public static void printMes(char c, int times, int maxTimes) {
    while (times > maxTimes) {
      times -= maxTimes;
    }
    for (int i = 0; i < times - 1; i++) {
      c++;
    }
    System.out.print(c);
  }

}

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

import java.io.IOException;
import java.util.Scanner;

public class KeitaiMessage {

  public static void main(String[] args) throws IOException {
    Scanner sc = new Scanner(System.in);
    String raw;
    char ch[] = new char[1025];
    int times = sc.nextInt();
    sc.nextLine();

    for (int i = 0; i < times; i++) {
      int cnt = 0;
      raw = sc.nextLine();

      for (int j = 0; j < raw.length(); j++) {
        ch[j] = raw.charAt(j);
      }

      for (int j = 0; j < raw.length(); j++) {
        try {
          if (ch[j] == '0' && ch[j - 1] != '0') {
            chooseLiteral(ch[j - 1], cnt);
            cnt = 0;
          } else if (ch[j] == '0') {
          } else {
            cnt++;
          }
        } catch (ArrayIndexOutOfBoundsException e) {
        }
      }
      System.out.println();
    }

    sc.close();
  }

  public static void chooseLiteral(char c, int times) {
    switch (c) {
    case '1':
      times %= 5;

      switch (times) {
      case 1:
        System.out.print('.');
        break;

      case 2:
        System.out.print(',');
        break;

      case 3:
        System.out.print('!');
        break;

      case 4:
        System.out.print('?');
        break;

      case 0:
        System.out.print(' ');
        break;

      default:
        System.out.println("there is exist a bug");
      }
      break;

    case '2':
      printMes('a', times, 3);
      break;

    case '3':
      printMes('d', times, 3);
      break;

    case '4':
      printMes('g', times, 3);
      break;

    case '5':
      printMes('j', times, 3);
      break;

    case '6':
      printMes('m', times, 3);
      break;

    case '7':
      printMes('p', times, 4);
      break;

    case '8':
      printMes('t', times, 3);
      break;

    case '9':
      printMes('w', times, 4);
      break;

    default:
      System.out.println("there is exist a bug");
    }
  }

  public static void printMes(char c, int times, int maxTimes) {
    while (times > maxTimes) {
      times -= maxTimes;
    }
    for (int i = 0; i < times - 1; i++) {
      c++;
    }
    System.out.print(c);
  }

}

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

import java.io.*;

class CharAt {
  public static void main(String[] args) throws IOException {
    String[][] strButton = {
      {".",",","!","?"," "},{"a","b","c"},{"d","e","f"},{"g","h","i"},{"j","k","l"},{"m","n","o"},{"p","q","r","s"},{"t","u","v"},{"w","x","y","z"}
    };

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    String str = br.readLine();
    int num = Integer.parseInt(str);

    String[] strArray = new String[num];
    int[][] numArray = new int[num][];

    for (int i = 0; i < num; i++) {
      strArray[i] = br.readLine(); 
      numArray[i] = new int[strArray[i].length()];

      for (int j = 0; j < strArray[i].length(); j++) {
        String str1 = String.valueOf(strArray[i].charAt(j));
        numArray[i][j] = Integer.parseInt(str1);
      }
    }

    String[][] strAnswer = new String[num][76];
    for (int i = 0; i < num; i++) {
      int num1 = 0;

      for (int j = 0; j < numArray[i].length; j++) {
        if (numArray[i][j] != 0) {
          int count = 1;
          int k;
          for (k = 0; numArray[i][j+k+1] != 0; k++) {
            count++;
          }

          int num2 = numArray[i][j] - 1;
          int num3;
          if (count % strButton[num2].length == 0) {
            num3 = strButton[num2].length - 1;
          }
          else {
            num3 = count % strButton[num2].length - 1;
          }

          strAnswer[i][num1] = strButton[num2][num3];

          num1++;
          j += k + 1;
        }
      }
    }

    for (int i = 0; i < num; i++) {
      for (int j = 0; strAnswer[i][j] != null; j++) {
        System.out.print(strAnswer[i][j]);
      }
      System.out.print("\n");
    }

    return 0;
  }
}

Compiler output:
Main.java:63: error: incompatible types: unexpected return value
    return 0;
           ^
1 error
Language: Java

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	String [][] letters = {{" "},{" ",".",",","!","?"},{"c","a","b"},{"f","d","e"},{"i","g","h"},{"l","j","k"},{"o","m","n"},{"s","p","q","r"},{"v","t","u"},{"z","w","x","y"},{" ","A","B","C","D","E","F","G","H","I"}};
    	int [] length = {0,5,3,3,3,3,3,4,3,4};
    	
    	int n = sc.nextInt();
    	for(int i=1;i<=n;i++) {
    		String str = sc.next();
    		String [] s = str.split("0");
    		String ans = "";
    		for(String ss:s) {
    			int l = ss.length();
    			if(l>0) {
    				int x = ss.charAt(0)-'0';
        			int y = length[x];
        			ans += letters[x][l%y];
    			}
    		}
    		System.out.println(ans);
        }
    }


Compiler output:
Main.java:24: error: reached end of file while parsing
    }
     ^
1 error
Language: Java

import java.util.Scanner;

public class　Main {
	public static void main(String[] args) {

		char[][] data = { { '.', ',', '!', '?', ' ' }, { 'a', 'b', 'c' },
				{ 'd', 'e', 'f' }, { 'g', 'h', 'i' }, { 'j', 'k', 'l' },
				{ 'm', 'n', 'o' }, { 'p', 'q', 'r', 's' }, { 't', 'u', 'v' },
				{ 'w', 'x', 'y', 'z' } };

		Scanner s = new Scanner(System.in);

		int n = s.nextInt();
		for (int i = 0; i < n; i++) {
			String str = s.next();
			int keta = str.length();

			int[] input = new int[keta];
			char[] inputc = new char[keta];
			String output = new String();

			for (int k = 0; k < keta; k++) {
				inputc[k] = str.charAt(k);
				// input[k] = Integer.parseInt("" + inputc[k]);
				input[k] = inputc[k] - '0';
				// System.out.println(input[k]);
			}

			// 以下、数字を文字列に直す処理をかく

			int in_count = 0;
			// int out_count = 0;
			int start;

			for (int m = 0; m < keta - 1; m++) {
				start = input[m];
				if (start == 0) {

				} else if (input[m + 1] == start) {
					in_count++;
				} else {
					int d = 3;
					if (start == 7 || start == 9)
						d = 4;
					else if (start == 1)
						d = 5;
					output += data[start - 1][in_count % d];
					// out_count++;
					in_count = 0;
				}
			}

			/*
			 * for (int t = 0; t < output.length; t++) { if (output[t] !=
			 * '\u0000') System.out.print(output[t]); }
			 */
			System.out.println(output);
		}
		s.close();
	}
}

Compiler output:
Main.java:3: error: illegal character: '\u3000'
public class?Main {
            ^
1 error
Language: C

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

int main(){
	int max;
	int count=0;
	char c[1025];
	int i,j;
	char key[10][5]={
		{0},
		{'.',',','!','?',' '},
		{'a','b','c'},
		{'d','e','f'},
		{'g','h','i'},
		{'j','k','l'},
		{'m','n','o'},
		{'p','q','r','s'},
		{'t','u','v'},
		{'w','x','y','z'},
	};
	int count;
	int counter=0;
	char d[77];
	char kiroku=0;
	
	scanf("%d",&max);
	
	while(counter<=max){
		gets(c);
		i=0;
		j=0;
		count=0;
		while(c[i]){
			if(c[i]!='0'){
				if(kiroku==c[i]){
					count++;
				}else{
					kiroku=c[i];
					count=0;
				}
			}else if(kiroku!=0){
				int test=3;
				switch(kiroku-'0'){
					case 1:test++;
					case 7:
					case 9:test++;
				}
				count=count%test;
				d[j]=key[kiroku-'0'][count];
				j++;
				kiroku=0;
			}
			i++;
		}
		d[j]=0;
		printf("%s\n",d);
		counter++;
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:21:13: error: redeclaration of 'count' with no linkage
   21 |         int count;
      |             ^~~~~
main.c:6:13: note: previous definition of 'count' with type 'int'
    6 |         int count=0;
      |             ^~~~~
main.c:29:17: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   29 |                 gets(c);
      |                 ^~~~
      |                 fgets
Language: C

from itertools import cycle as c

n=int(input())
for _ in range(n):
    tt=input()
    l=[]
    t=""
    for (i,j) in enumerate(tt):
        ct=int(j)
        if ct==0 or i==0:
            if i!=0:
                l.extend([t])
                t=""
            kk=[c([".",",","!","?"," "]),
                c(["a","b","c"]),
                c(["d","e","f"]),
                c(["g","h","i"]),
                c(["j","k","l"]),
                c(["m","n","o"]),
                c(["p","q","r","s"]),
                c(["t","u","v"]),
                c(["w","x","y","z"])]
        if ct!=0 :
            t=kk[ct-1].next()
    print("".join(l))


Compiler output:
main.c:1:1: error: unknown type name 'from'
    1 | from itertools import cycle as c
      | ^~~~
main.c:1:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'import'
    1 | from itertools import cycle as c
      |                ^~~~~~
main.c:1:16: error: unknown type name 'import'
Language: C

#include<stdio.h>
#include<stdlib.h>
#define MAXSIZE 1024
#define MAXLENGTH 76

int main(void)
{
  int i,j,c;
  int n;
  char *a,*b;

  scanf("%d ",&n);
  
  for(i=0;i<n;i++)
    {
      a = (char *)malloc(sizeof(char)*MAXLENGTH);
      b = (char *)malloc(sizeof(char)*MAXSIZE);
      gets(a);
      j = 0;
      while(1)
	{
	  if(a[j]=='\0')break;
	  c = 0;
	  while(1)
	    { 
	      if(a[j]=='0'){
		break;
	      }else{
		j++;
		c++;
	      }
	    }
	      if(a[j-1] == '1'){
	        if(c%5==1){printf(".");}
	        else if(c%5==2){printf(",");}
		else if(c%5==3){printf("!");}
		else if(c%5==4){printf("?");}
		else{printf(" ");}
	      }else if(a[j-1]=='7'){
		if(c%4==1){printf("p");}
	        else if(c%4==2){printf("q");}
		else if(c%4==3){printf("r");}
		else{printf("s");}
	      }else if(a[j-1]=='9'){
		if(c%4==1){printf("w");}
	        else if(c%4==2){printf("x");}
		else if(c%4==3){printf("y");}
		else{printf("z");}
	      }else if(a[j-1]=='2'){
		if(c%3==1){printf("a");}
	        else if(c%3==2){printf("b");}
		else{printf("c");}
	      }else if(a[j-1]=='3'){
		if(c%3==1){printf("d");}
	        else if(c%3==2){printf("e");}
		else{printf("f");}
              }else if(a[j-1]=='4'){
		if(c%3==1){printf("g");}
	        else if(c%3==2){printf("h");}
		else{printf("i");}   
	      }else if(a[j-1]=='5'){
		if(c%3==1){printf("j");}
	        else if(c%3==2){printf("k");}
		else{printf("l");}	     
	      }else if(a[j-1]=='6'){
		if(c%3==1){printf("m");}
	        else if(c%3==2){printf("n");}
		else{printf("o");}	     
	      }else if(a[j-1]=='8'){
		if(c%3==1){printf("t");}
	        else if(c%3==2){printf("u");}
		else{printf("v");}
	      }	  
	      j++;
	}
      printf("\n");
    }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:18:7: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   18 |       gets(a);
      |       ^~~~
      |       fgets
Language: C

#include<stdio.h>
#include<stdlib.h>
#define MAXSIZE 1024
#define MAXLENGTH 76

int main(void)
{
  int i,j,c;
  int n;
  char *a;

  scanf("%d ",&n);
  
  for(i=0;i<n;i++)
    {
      a = (char *)malloc(sizeof(char)*MAXLENGTH);
      gets(a);
      j = 0;
      while(1)
	{
	  if(a[j]=='\0')break;
	  c = 0;
	  while(1)
	    { 
	      if(a[j]=='0'){
		break;
	      }else{
		j++;
		c++;
	      }
	    }
	      if(a[j-1] == '1'){
	        if(c%5==1){printf(".");}
	        else if(c%5==2){printf(",");}
					else if(c%5==3){printf("!");}
					else if(c%5==4){printf("?");}
					else{printf(" ");}
	      }else if(a[j-1]=='7'){
					if(c%4==1){printf("p");}
	        else if(c%4==2){printf("q");}
					else if(c%4==3){printf("r");}
					else{printf("s");}
	      }else if(a[j-1]=='9'){
					if(c%4==1){printf("w");}
	        else if(c%4==2){printf("x");}
					else if(c%4==3){printf("y");}
					else{printf("z");}
	      }else if(a[j-1]=='2'){
					if(c%3==1){printf("a");}
	        else if(c%3==2){printf("b");}
					else{printf("c");}
	      }else if(a[j-1]=='3'){
					if(c%3==1){printf("d");}
	        else if(c%3==2){printf("e");}
					else{printf("f");}
        }else if(a[j-1]=='4'){
					if(c%3==1){printf("g");}
	        else if(c%3==2){printf("h");}
					else{printf("i");}   
	      }else if(a[j-1]=='5'){
					if(c%3==1){printf("j");}
	        else if(c%3==2){printf("k");}
					else{printf("l");}	     
	      }else if(a[j-1]=='6'){
					if(c%3==1){printf("m");}
	        else if(c%3==2){printf("n");}
					else{printf("o");}	     
	      }else if(a[j-1]=='8'){
					if(c%3==1){printf("t");}
	        else if(c%3==2){printf("u");}
					else{printf("v");}
	      }	  
	      j++;
			}
      printf("\n");
    }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:7: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   17 |       gets(a);
      |       ^~~~
      |       fgets
Language: C++

#include <iostream>
using namespace std;


int X;
char s[1050];

string b[9] = {".,!? ","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"};


int main(){

  cin >> X;
  while(X){

    cin >> s;

    int i = 0;
    char pre;
    int n;

    for(i = 0; i < strlen(s); i++){
      n = 1;
     
      pre = s[i];
      if(pre == '0') continue;
      while(pre == s[i+1] && i < strlen(s)){
	n++;
	i++;
      }
      int x = atoi(&pre);
   
      cout <<  b[x-1][(n-1) % b[x-1].length()];
    }
    cout << endl;
    X--;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:20: error: 'strlen' was not declared in this scope
   22 |     for(i = 0; i < strlen(s); i++){
      |                    ^~~~~~
a.cc:2:1: note: 'strlen' 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 <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <limits.h>


int main()
{
	int i,j,k;
	int n,m;
	int a[10]={0}; //押された回数
	int b[10]={0,4,3,3,3,3,3,4,3,4}; //割り算	 
	int c; //押されたボタン
	char d[5][10]={
	{'0','?','c','f','i','l','o','s','v','z'},
	{'0','.','a','d','g','j','m','p','t','w'},
	{'0',',','b','e','h','k','n','q','u','x'},
	{'0','!','0','0','0','0','0','r','0','y'}
	{'0',' ','0','0','0','0','0','0','0','0'}};
	char e[77];
	
	scanf("%d",&n);

	for(i=0;i<n;i++)
	{
		scanf("%s",e);
		for(j=0;j<strlen(e);j++)
		{
			if(e[j]=='0'){
				printf("%c",d[a[c]%b[c]][c]);
				a[c]=0;
			}else
			{
				if(e[j]=='1')c=1;
				else if(e[j]=='2')c=2;
				else if(e[j]=='3')c=3;
				else if(e[j]=='4')c=4;
				else if(e[j]=='5')c=5;
				else if(e[j]=='6')c=6;
				else if(e[j]=='7')c=7;
				else if(e[j]=='8')c=8;
				else if(e[j]=='9')c=9;
				a[c]++;
			}
		}
		printf("\n");
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: expected '}' before '{' token
   20 |         {'0',' ','0','0','0','0','0','0','0','0'}};
      |         ^
a.cc:15:23: note: to match this '{'
   15 |         char d[5][10]={
      |                       ^
a.cc:20:9: error: expected ',' or ';' before '{' token
   20 |         {'0',' ','0','0','0','0','0','0','0','0'}};
      |         ^
a.cc: At global scope:
a.cc:23:14: error: expected constructor, destructor, or type conversion before '(' token
   23 |         scanf("%d",&n);
      |              ^
a.cc:25:9: error: expected unqualified-id before 'for'
   25 |         for(i=0;i<n;i++)
      |         ^~~
a.cc:25:17: error: 'i' does not name a type
   25 |         for(i=0;i<n;i++)
      |                 ^
a.cc:25:21: error: 'i' does not name a type
   25 |         for(i=0;i<n;i++)
      |                     ^
a.cc:50:9: error: expected unqualified-id before 'return'
   50 |         return 0;
      |         ^~~~~~
a.cc:51:1: error: expected declaration before '}' token
   51 | }
      | ^
Language: C++

5
20
220
222220
44033055505550666011011111090666077705550301110
000555555550000330000444000080000200004440000

Compiler output:
a.cc:5:1: warning: integer constant is too large for its type
    5 | 44033055505550666011011111090666077705550301110
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:6:1: error: invalid digit "8" in octal constant
    6 | 000555555550000330000444000080000200004440000
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 5
      | ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
	char moji[10][6];
	strcpy(moji[1],".,!? ");
	strcpy(moji[2] ,"abc  ");
strcpy(moji[3], "def  ");
strcpy(moji[4],"ghi  ");
strcpy(moji[5],"jkl  ");
strcpy(moji[6],"mno  ");
strcpy(moji[7],"pqrs ");
strcpy(moji[8],"tuv  ");
strcpy(moji[9],"wxyz ");

	string str;
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>str;
		int cnt=0;
		int num=0;
		for(int j=0;j<str.size();j++){
			if(str.at(j)=='0')continue;
			cnt=0;
			num=str.at(j)-'0';
			if(j==str.size()-2){
				cout<<moji[num][cnt];
				break;
			}

			while(str.at(j)==str.at(j+1)){
				cnt++;
				j++;
				if(j==str.size()-2){
					break;
				}
			}

			if(num==1){
				cnt%=5;
			}
			else if(num==7||num==9){
				cnt%=4;
			}
			else{
				cnt%=3;
			}

			cout<<moji[num][cnt];
		}
		cout<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'strcpy' was not declared in this scope
    8 |         strcpy(moji[1],".,!? ");
      |         ^~~~~~
a.cc:2:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

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


void main(){
	char list[][6]={
	{"     "},
	{".,!? "},
	{"abc  "},
	{"def  "},
	{"ghi  "},
	{"jkl  "},
	{"mno  "},
	{"pqrs "},
	{"tuv  "},
	{"wxyz "} };
	int m[10] = {1,5,3,3,3,3,3,4,3,4};
	int count,n,i,buf;
	string str;
	cin >> n;
	while(n--){
		cin >> str;
		count=0;
		for(i=0;i<str.size() && str[i]=='0';i++);
		for(;i<str.size();i++){
			if(str[i]!='0'){
				count++;
			}else{
				if(str[i-1]!='0'){
				buf = (int)str[i-1] - (int)'0';
				cout << list[buf][(count-1) % m[buf]];
				count=0;
				}else{
					count=0;
				}
			}
		}
		cout << endl;
	}
}

Compiler output:
a.cc:6:1: error: '::main' must return 'int'
    6 | void main(){
      | ^~~~
Language: C++

#include<iostream>
using namespace std;
const char button[10][6] = {	{},
								{'.',',','!','?',' '},
								{'a','b','c'},
								{'d', 'e', 'f'}, 
								{'g', 'h', 'i'},
								{'j', 'k', 'l'},
								{'m', 'n', 'o'},
								{'p', 'q', 'r', 's'},
								{'t', 'u', 'v'},
								{'w', 'x', 'y', 'z',}};
const int num[10] = {0,5,3,3,3,3,3,4,3,4};
int main()
{
	int n;
	cin >> n;
	char line[1024];
	for (int i = 0; i < n; i++)
	{
		cin >> line;
		int len = strlen(line);
		int j = 0;
		while (j < len)
		{
			int next = j + 1;
			int count = 0;
			while(next < len  && line[next] == line[j])
			{
				next++;
				count++;
			}
			if ((line[j] - '0') != 0)
			{
				int number = line[j] - '0';
				int length = num[number];
				cout << button[number][count % length];
			}
			count = 0;
			j = next;
		}
		cout<<endl;

	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:27: error: 'strlen' was not declared in this scope
   22 |                 int len = strlen(line);
      |                           ^~~~~~
a.cc:2:1: note: 'strlen' 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>
#include<stdlib.h>
using namespace std;
const char button[10][6] = {	{},
								{'.',',','!','?',' '},
								{'a','b','c'},
								{'d', 'e', 'f'}, 
								{'g', 'h', 'i'},
								{'j', 'k', 'l'},
								{'m', 'n', 'o'},
								{'p', 'q', 'r', 's'},
								{'t', 'u', 'v'},
								{'w', 'x', 'y', 'z',}};
const int num[10] = {0,5,3,3,3,3,3,4,3,4};
int main()
{
	int n;
	cin >> n;
	char line[1024];
	for (int i = 0; i < n; i++)
	{
		cin >> line;
		int len = strlen(line);
		int j = 0;
		while (j < len)
		{
			int next = j + 1;
			int count = 0;
			while(next < len  && line[next] == line[j])
			{
				next++;
				count++;
			}
			if ((line[j] - '0') != 0)
			{
				int number = line[j] - '0';
				int length = num[number];
				cout << button[number][count % length];
			}
			count = 0;
			j = next;
		}
		cout<<endl;

	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:27: error: 'strlen' was not declared in this scope
   23 |                 int len = strlen(line);
      |                           ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<stdlib.h>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<queue>
#include<stack>
#include<map>
#include<set>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<pii,int> piii;
typedef pair<ll,ll> pll;

#define reps(i,f,n) for(int i = int(f); i <= int(n); i++)
#define rep(i,n) reps(i,0,int(n)-1)
#define rrep(i,n) for(int i = n-1; i >= 0; i--)

#define all(x) (x).begin(),(x).end()
#define X first
#define Y second

#define sz size()
#define eb emplace_back

char str[12][5] ={"",".,!? ","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"};
int mod[12] = {0,5,3,3,3,3,3,4,3,4};

int main(void){
  int n;
  cin >> n;
  rep(test,n){
    string s;
    cin >> s;
    int num = -1;
    int cnt = -1;
    rep(i,s.sz){
      if(s[i] == '0'){
        if(num != -1){
          printf("%c", str[num][cnt%mod[num]]);
          num = -1;
          cnt = -1;
        }
      }else{
        num = s[i] - '0';
        cnt++;
      }
    }
    puts("");
  }
  return 0;
}

Compiler output:
a.cc:29:22: error: initializer-string for 'char [5]' is too long [-fpermissive]
   29 | char str[12][5] ={"",".,!? ","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"};
      |                      ^~~~~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>

using namespace std;
int main(){
  char m[9][5]={{'.',',','!','?',' '},
		{'a','b','c','1','1'},
		{'d','e','f','1','1'},
		{'g','h','i','1','1'},
		{'j','k','l','1','1'},
		{'m','n','o','1','1'},
		{'p','q','r','s','1'},
		{'t','u','v','1','1'},
		{'w','x','y','z','1'}};

  int a,count=0,c[100],d;
  char b[100000000000][1024];
  cin>>a;
  for(int i=0;i<a;i++){
    scanf("%s",b[i]);
    c[i]=strlen(b[i]);
    for(int j=0;j<c[i];j++){
      if(b[i][j]!='0')count++;
      else
	if(b[i][j-1]!=0){
	  d=(int)(b[i][j-1])-48;

	  if(d==1)
	    if(count%5!=0)
	      cout<<m[d-1][count%5-1];
	    else cout<<m[d-1][4];

	  else if(d==7 || d==9)
	    if(count%4!=0)
	      cout<<m[d-1][count%4-1];
	    else cout<<m[d-1][3];

	  else
	    if(count%3!=0)
	      cout<<m[d-1][count%3-1];
	    else cout<<m[d-1][2]; 
	  count=0;
	}
    }
    cout<<endl;
  }
  return 0;
}
#include<iostream>
#include<cstdio>
#include<cstring>

using namespace std;
int main(){
  char m[9][5]={{'.',',','!','?',' '},
		{'a','b','c','1','1'},
		{'d','e','f','1','1'},
		{'g','h','i','1','1'},
		{'j','k','l','1','1'},
		{'m','n','o','1','1'},
		{'p','q','r','s','1'},
		{'t','u','v','1','1'},
		{'w','x','y','z','1'}};

  int a,count=0,c[100],d;
  char b[100][1025];
  cin>>a;
  for(int i=0;i<a;i++){
    scanf("%s",b[i]);
    c[i]=strlen(b[i]);
    for(int j=0;j<c[i];j++){
      if(b[i][j]!='0')count++;
      else
	if(b[i][j-1]!=0){
	  d=(int)(b[i][j-1])-48;

	  if(d==1)
	    if(count%5!=0)
	      cout<<m[d-1][count%5-1];
	    else cout<<m[d-1][4];

	  else if(d==7 || d==9)
	    if(count%4!=0)
	      cout<<m[d-1][count%4-1];
	    else cout<<m[d-1][3];

	  else
	    if(count%3!=0)
	      cout<<m[d-1][count%3-1];
	    else cout<<m[d-1][2]; 
	  count=0;
	}
    }
    cout<<endl;
  }
  return 0;
}

Compiler output:
a.cc:55:5: error: redefinition of 'int main()'
   55 | int main(){
      |     ^~~~
a.cc:6:5: note: 'int main()' previously defined here
    6 | int main(){
      |     ^~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>

using namespace std;
int main(){
  char m[9][5]={{'.',',','!','?',' '},
		{'a','b','c','1','1'},
		{'d','e','f','1','1'},
		{'g','h','i','1','1'},
		{'j','k','l','1','1'},
		{'m','n','o','1','1'},
		{'p','q','r','s','1'},
		{'t','u','v','1','1'},
		{'w','x','y','z','1'}};

  int a,count=0,c[100],d;
  char b[100][1025];
  cin>>a;
  for(int i=0;i<a;i++){
    scanf("%s",b[i]);
    c[i]=strlen(b[i]);
    for(int j=0;j<c[i];j++){
      if(b[i][j]!='0')count++;
      else
	if(b[i][j-1]!=0){
	  d=(int)(b[i][j-1])-48;

	  if(d==1)
	    if(count%5!=0)
	      cout<<m[d-1][count%5-1];
	    else cout<<m[d-1][4];

	  else if(d==7 || d==9)
	    if(count%4!=0)
	      cout<<m[d-1][count%4-1];
	    else cout<<m[d-1][3];

	  else
	    if(count%3!=0)
	      cout<<m[d-1][count%3-1];
	    else cout<<m[d-1][2]; 
	  count=0;
	}
    }
    cout<<endl;
  }
  return 0;
}
#include<iostream>
#include<cstdio>
#include<cstring>

using namespace std;
int main(){
  char m[9][5]={{'.',',','!','?',' '},
		{'a','b','c','1','1'},
		{'d','e','f','1','1'},
		{'g','h','i','1','1'},
		{'j','k','l','1','1'},
		{'m','n','o','1','1'},
		{'p','q','r','s','1'},
		{'t','u','v','1','1'},
		{'w','x','y','z','1'}};

  int a,count=0,c[100],d;
  char b[100][1025];
  cin>>a;
  for(int i=0;i<a;i++){
    scanf("%s",b[i]);
    c[i]=strlen(b[i]);
    for(int j=0;j<c[i];j++){
      if(b[i][j]!='0')count++;
      else
	if(b[i][j-1]!=0){
	  d=(int)(b[i][j-1])-48;

	  if(d==1)
	    if(count%5!=0)
	      cout<<m[d-1][count%5-1];
	    else cout<<m[d-1][4];

	  else if(d==7 || d==9)
	    if(count%4!=0)
	      cout<<m[d-1][count%4-1];
	    else cout<<m[d-1][3];

	  else
	    if(count%3!=0)
	      cout<<m[d-1][count%3-1];
	    else cout<<m[d-1][2]; 
	  count=0;
	}
    }
    cout<<endl;
  }
  return 0;
}

Compiler output:
a.cc:55:5: error: redefinition of 'int main()'
   55 | int main(){
      |     ^~~~
a.cc:6:5: note: 'int main()' previously defined here
    6 | int main(){
      |     ^~~~