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

#include <iostream>
#include <map>
#include <vector>
using namespace std;

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

struct Type
{
  int value, start, end;
  Type(int value = 0, int start = 0, int end = 0) : value(value), start(start), end(end) {}
};

int H, W, N;
Type types[8];
map<char, int> table;
char board[20][20];
int memo[20][20][101][1 << 8];

int rec(int x, int y, int t, int used)
{
	if(t == 101) return 0;
	if(used + 1 == 1 << N) return 0;
	if(memo[x][y][t][used] != -1) return memo[x][y][t][used];
	
	int res = 0;
	for(int i = 0; i < 5; i++)
	{
		int nx = x + dx[i], ny = y + dy[i];
		
		if(0 <= nx && nx < W && 0 <= ny && ny <H)
		{
			char data = board[nx][ny];
			
			if('0' <= data && data <= '9')
			{
				int idx = table[data];
				int s = types[idx].start;
				int e = types[idx].end;
				
				if(s <= t && t < e && (used & 1 << idx) == 0)
					res = max(res, rec(x, y, t, used | 1 << idx) + types[idx].value);
			}
			else res = max(res, rec(nx, ny, t + 1, used));
		}
	}
	
	return memo[x][y][t][used] = res;
}	

int solve()
{
	memset(memo, -1, sizeof memo);
	
	int X, Y;
	
	for(int y = 0; y < H; y++)
	{
		for(int x = 0; x < W; x++)
		{
			char k;
			cin >> k;
			
			board[x][y] = k;
			
			if(board[x][y] == 'P')
			{
				X = x;
				Y = y;
			}
		}
	}
	
	cin >> N;
	
	for(int i = 0; i < N; i++)
	{
		char c;
		cin >> c >> types[i].value >> types[i].start >> types[i].end;
		
		table[c] = i;
	}
	
	return rec(X, Y, 0, 0);
}

int main()
{
  for(; cin >> W >> H && W;)
  	cout << solve() << endl;
}

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

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

struct node{
	int x,y,bit,t;
	node(int x,int y,int bit,int t) : x(x) , y(y) , bit(bit) , t(t) {}
};

int x,y;
int sx,sy;
int n;
char c[22][22];
int num[10],d[10],s[10],e[10];
int value[1<<10];
int done[22][22][1<<10][102];
int dx[5]={0,0,1,-1,0},dy[5]={1,-1,0,0,0};

int main(void){
	while(1){
		scanf("%d%d",&x,&y);
		if(x==0 && y==0)break;
		queue<node> que;
		for(int i=0;i<=21;i++){
			for(int j=0;j<=21;j++){
				c[i][j]='#';
			}
		}
		for(int i=1;i<=y;i++){
			for(int j=1;j<=x;j++){
				cin >> c[j][i];
				if(c[j][i]=='P'){
					que.push(node(j,i,0,0));
					c[j][i]='.';
				}
			}
		}
		scanf("%d",&n);
		for(int i=0;i<n;i++){
			int a;
			scanf("%d",&a);
			scanf("%d%d%d",&d[a],&s[a],&e[a]);
		}
		for(int i=0;i<(1<<n);i++){
			for(int j=0;j<n;j++){
                value[i]+=(i>>j&1)*d[j];
            }
            //cout << value[i] << " " << i << endl;
        }
		memset(done,0,sizeof(done));
		int ans=0;
		while(que.size()){
			node q=que.front();que.pop();
			if(q.t>100)continue;
			if(c[q.x][q.y]!='.')continue;
			for(int i=0;i<4;i++){
				int tx=q.x+dx[i];
				int ty=q.y+dy[i];
				if(c[tx][ty]>='0' && c[tx][ty]<='9'){
					int idx=c[tx][ty]-'0';
					if(s[idx]<=q.t && q.t<e[idx])q.bit |= 1<<idx;
				}
			}
			if(done[q.x][q.y][q.bit][q.t]++)continue;
			ans=max(ans,value[q.bit]);
			for(int i=0;i<5;i++){
				que.push(node(q.x+dx[i],q.y+dy[i],q.bit,q.t+1));
			}
		}
		cout << ans << endl;
	}
    return 0;
}

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

#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;

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

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

const int INF = 1001001001;
const double EPS = 1e-10;

struct Data {
	int y, x, t, mask;
	Data(int y, int x, int t, int m) : y(y), x(x), t(t), mask(m) {}
};

struct Sale {
	int d, s, e;
};

const int dy[] = {-1, 0, 1, 0};
const int dx[] = {0, -1, 0, 1};
bool visited[20][20][100][1<<8];
int main()
{
	int h, w;
	while(scanf("%d%d", &w, &h), w){
		char field[20][20];
		rep(i, h) rep(j, w){
			char c[4];
			scanf("%s", c);
			field[i][j] = c[0];
		}

		int n;
		scanf("%d", &n);

		int dict[10];
		fill(dict, dict+10, -1);
		Sale sale[8];
		rep(i, n){
			int g;
			scanf("%d%d%d%d", &g, &sale[i].d, &sale[i].s, &sale[i].e);
			dict[g] = i;
			if(sale[i].s == 100){
				assert(false);
				for(;;);
			}
		}

		rep(i, h) rep(j, w){
			if(isdigit(field[i][j])){
				int v = dict[field[i][j] - '0'];
				if(v == -1)
					field[i][j] = 'x';
				else
					field[i][j] = v + '0';
			}
		}

		int mask[20][20];
		rep(i, h) rep(j, w){
			if(isdigit(field[i][j]) || field[i][j] == 'x')
				mask[i][j] = -1;
			else{
				mask[i][j] = 0;
				rep(k, 4){
					int py = i + dy[k];
					int px = j + dx[k];
					if(py<0 || h<=py || px<0 || w<=px)
						continue;
					if(isdigit(field[py][px]))
						mask[i][j] |= 1 << (field[py][px] - '0');
				}
			}
		}

		int money[1<<8];
		rep(m, 1<<n){
			money[m] = 0;
			rep(i, n){
				if((m>>i)&1)
					money[m] += sale[i].d;
			}
		}
		
		queue<Data> Q;
		rep(i, h) rep(j, w){
			if(field[i][j] == 'P'){
				Q.push(Data(i, j, 0, 0));
				goto next;
			}
		}

next:
		int ans = 0;
		while(!Q.empty()){
			Data d = Q.front();
			Q.pop();
			rep(i, n){
				if(((mask[d.y][d.x]>>i)&1) && sale[i].s<=d.t && d.t<sale[i].e)
					d.mask |= 1 << i;
			}
			if(visited[d.y][d.x][d.t][d.mask])
				continue;
			visited[d.y][d.x][d.t][d.mask] = true;
			ans = max(ans, money[d.mask]);
			if(d.t == 99)
				continue;

			Q.push(Data(d.y, d.x, d.t+1, d.mask));
			rep(k, 4){
				int py = d.y + dy[k];
				int px = d.x + dx[k];
				if(py<0 || h<=py || px<0 || w<=px || mask[py][px]==-1)
					continue;
				Q.push(Data(py, px, d.t+1, d.mask));
			}
		}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:65:33: error: 'assert' was not declared in this scope
   65 |                                 assert(false);
      |                                 ^~~~~~
a.cc:15:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
   14 | #include <stack>
  +++ |+#include <cassert>
   15 | #include <string>
Language: C++

#include<iostream>
#include<vector>
#include<cmath>
#include<Windows.h>

using namespace std;

void part(int x, vector<int> &d, vector<vector<int> > &a, int pre)
{
	if ( x == 0 ) {
		a.push_back(d);
	}
	
	for (int i = pre; i >= 1; --i) {
		if (x - i >= 0) {
			d.push_back(i);
			part(x - i, d, a, i);
			d.pop_back();
		}
	}
}

const int NPAT = 41;
int res;
int parts[NPAT][9];

inline int ideal(int m[])
{
	int ret = 0;
	
	for (int i = 0; i < 9; ++i) {
		ret += (i+1) * m[i];
	}

	return ret / 10;
}

bool solve(int m[], int pre, int step)
{
	if ( res < step ) {
		res = step;
	}
	
	if ( step + ideal(m) <= res ) {
		return false;
	}
	
	for (int i = pre; i < NPAT; ++i) {
		bool packable = true;
		
		for (int j = 0; j < 9; ++j) {
			if (m[j] < parts[ i ][ j ]) {
				packable = false;
			}
		}

		if ( packable ) {
			// Translate
			for (int j = 0; j < 9; ++j) {
				m[j] -= parts[ i ][ j ];
			}

			// solve(m, i, step + 1);
			if (solve(m, i, step + 1)) return true;

			// Rollback
			for ( int j = 0; j < 9; ++j ) {
				m[j] += parts[ i ][ j ];
			}
		}
	}
	// cout << (res) << endl;
	return true;
}

int main(void)
{
	vector<int> d;
	vector< vector<int> > s;
	part(10, d, s, 9);


	for (int sz = 2; sz < 22; ++sz){
		for (int i = 0; i < s.size(); ++i){
			if (s[i].size() == sz){
				for (int j = 0; j < s[i].size(); ++j){
					parts[i][s[i][j] - 1]++;
				}
			}
		}
	}

	while ( true ) {
		int n;
		int m[9] = { 0, };
		
		cin >> n;
		
		if (n == 0) {
			break;
		}

		for (int i = 0; i < n; ++i) {
			int tmp;
			cin >> tmp;
			m[tmp - 1]++;
		}

		res = 0;
		solve(m, 0, 0);

		cout << res << endl;
	}
	return 0;
}

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

#include <bits/stdc++.h>

typedef unsigned long long hash_t;

std::mt19937 RND;
std::uniform_int_distribution<hash_t> DST;
#define random() (DST(RND))

hash_t hash_table[10][101];
std::vector<std::vector<int>> T;
std::map<hash_t, int> dp;

void dfs(int i, int s, std::vector<int> &v)
{
	if (s == 0){
		T.emplace_back(v);
		return;
	}
	if (i > 9) return;
	if (i > s) return;
	
	v[i]++;
	dfs(i, s - i, v);
	v[i]--;
	
	dfs(i + 1, s, v);
}

inline hash_t getHash(const std::vector<int> &v)
{
	hash_t res = 0;
	for (int i = 0; i < 10; i++){
		res ^= hash_table[i][v[i]];
	}
	return res;
}

int calc(std::vector<int> &v, int pos = 0)
{
	if (pos == T.size()) return 0;
	hash_t hash = getHash(v);
	if (dp.count(hash)) return dp[hash];
	
	int res = calc(v, pos + 1);
	auto &table = T[pos];
	
	int k = 99;
	for (int i = 0; i < table.size(); i++){
		if (table[i] == 0) continue;
		k = std::min(k, v[i] / table[i]);
	}
	for (int i = 1; i <= k; i++){
		for (int j = 0; j < table.size(); j++){
			v[j] -= table[j];
		}
		res = std::max(res, k + calc(v, pos + 1));
	}
	for (int j = 0; j < table.size(); j++){
		v[j] += table[j] * k;
	}
	
	return dp[hash] = res;
}

int main()
{	
	for (int i = 0; i < 10; i++){
		for (int j = 0; j <= 100; j++){
			hash_table[i][j] = random();
		}
	}
	
	dfs(1, 10, std::vector<int>(10, 0));
	
	int n;
	while (std::cin >> n, n){
		std::vector<int> v(10, 0);
		for (int i = 0; i < n; i++){
			int a;
			std::cin >> a;
			v[a]++;
		}
		
		printf("%d\n", calc(v));
		dp.clear();
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:73:25: error: cannot bind non-const lvalue reference of type 'std::vector<int>&' to an rvalue of type 'std::vector<int>'
   73 |         dfs(1, 10, std::vector<int>(10, 0));
      |                         ^~~~~~~~~~~~~~~~~~
a.cc:13:42: note:   initializing argument 3 of 'void dfs(int, int, std::vector<int>&)'
   13 | void dfs(int i, int s, std::vector<int> &v)
      |                        ~~~~~~~~~~~~~~~~~~^
Language: C++

5
4 9 1 3 8
10
8 5 3 6 2 1 4 5 4 5
9
5 7 3 8 2 9 6 4 1
100
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1
2 2 2 2 2 2 2 2 2 2
2 2 2 2 2 2 2 2 2 2
3 3 3 3 3 4 4 4 4 4
3 3 3 3 3 4 4 4 4 4
5 5 5 5 5 6 6 6 6 6
7 7 7 7 7 8 8 8 8 8
9 9 9 9 9 9 9 9 9 9
0

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

#include <iostream>
using namespace std;

int N;
int manto[11];

bool dfs(int No, int sum)
{
	int x = manto[10];


	if(sum == 10){
		return true;
	}

	else if(sum > 10)
		return false;
	
	for(int i = No; i > 0; i--){
		if(manto[i] > 0){
			manto[i]--;
			if(!dfs(i,sum+i))
				manto[i]++;
			else{
				if(No == 9)
					manto[10]++;
				return true;
			}

		}
	}

	return false;
}



int main()
{
	while(cin >> N, N){
		int a;
		for(int i = 0; i <= 10; i++){
			manto[i] = 0;
		}
		for(int i = 0; i < N; i++){
			cin >> a;
			manto[a]++;
		}

		for(int i = 0; i < 9; i++){
			if(i == 5){
				if(manto[i] >= 2){
					while(manto[i] >= 2){
						manto[i] -= 2;
						manto[10]++;
					}
				}
			}
			else if(manto[i] > 0 && manto[10-i] > 0){
				while(manto[i] > 0 && manto[10-i] > 0){
					manto[i]--;
					manto[10-i]--;
					manto[10]++;
				}
			}
		}

		while(dfs(9,0));
		printf("%d\n", manto[10])
	}





	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:69:42: error: expected ';' before '}' token
   69 |                 printf("%d\n", manto[10])
      |                                          ^
      |                                          ;
   70 |         }
      |         ~
Language: C++

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

int N;
int manto[11];

bool dfs(int No, int sum)
{
	int x = manto[10];


	if(sum == 10){
		return true;
	}

	else if(sum > 10)
		return false;
	
	for(int i = No; i > 0; i--){
		if(manto[i] > 0){
			manto[i]--;
			if(!dfs(i,sum+i))
				manto[i]++;
			else{
				if(No == 9)
					manto[10]++;
				return true;
			}

		}
	}

	return false;
}



int main()
{
	while(cin >> N, N){
		int a;
		for(int i = 0; i <= 10; i++){
			manto[i] = 0;
		}
		for(int i = 0; i < N; i++){
			cin >> a;
			manto[a]++;
		}

		for(int i = 0; i < 9; i++){
			if(i == 5){
				if(manto[i] >= 2){
					while(manto[i] >= 2){
						manto[i] -= 2;
						manto[10]++;
					}
				}
			}
			else if(manto[i] > 0 && manto[10-i] > 0){
				while(manto[i] > 0 && manto[10-i] > 0){
					manto[i]--;
					manto[10-i]--;
					manto[10]++;
				}
			}
		}

		while(dfs(9,0));
		printf("%d\n", manto[10])
	}





	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:70:42: error: expected ';' before '}' token
   70 |                 printf("%d\n", manto[10])
      |                                          ^
      |                                          ;
   71 |         }
      |         ~
Language: C++

#include <algorithm>
#include <iostream>
#include <queue>
#include <unordered_set>
#include <vector>

using namespace std;

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

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

int h, w;
char field[16][16];
int label[16][16];

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

int labeling(int y, int x, int l)
{
    int ret = 1;
    label[y][x] = l;
    
    rep(i, 4){
        int py = y + dy[i];
        int px = x + dx[i];
        if(py<0 || h<=py || px<0 || w<=px) continue;
        if(field[py][px] == 'X' && label[py][px] == 0){
            ret += labeling(py, px, l);
        }
    }
    
    return ret;
}

struct Data
{
    int y, x, cost;
    vi broken;
    
    bool operator== (const Data& d) const
    {
        return y == d.y && x == d.x && broken == d.broken;
    }
};

template<>
struct hash<Data>
{
    size_t operator()(const Data& d) const
    {
        size_t h = d.y ^ d.x;
        rep(i, d.broken.size()) h ^= d.broken[i] << i;
        return h;
    }
};

int func()
{
    rep(i, h) rep(j, w) label[i][j] = 0;
    
    rep(i, h){
        cin >> field[i];
    }
    
    vi area;
    rep(y, h) rep(x, w){
        if(field[y][x] == 'X' && label[y][x] == 0){
            area.push_back(labeling(y, x, area.size() + 1));
        }
    }
    
    for(int& a : area){
        a /= 2;
    }
    
    queue<Data> Q;
    unordered_set<Data> visited;
    
    rep(y, h) rep(x, w){
        if(field[y][x] == 'S'){
            Q.push({y, x, 0, area});
            visited.insert(Q.front());
        }
    }
    
    while(!Q.empty()){
        Data d = Q.front();
        Q.pop();
        
        rep(i, 4){
            int py = d.y + dy[i];
            int px = d.x + dx[i];
            if(py<0 || h<=py || px<0 || w<=px || field[py][px] == '#') continue;
            
            Data next;
            if(field[py][px] == 'G'){
                return d.cost + 1;
            }
            else if(field[py][px] == 'X'){
                int& b = d.broken[label[py][px]-1];
                if(b == 0) continue;
                --b;
                next = {py, px, d.cost + 1, d.broken};
                ++b;
            }
            else{
                next = {py, px, d.cost + 1, d.broken};
            }
            
            if(visited.count(next)) continue;
            
            Q.push(next);
            visited.insert(next);
        }
    }
    
    return 0;
}
    
int main()
{
    while(cin >> w >> h, w){
        printf("%d\n", func());
    }
}

Compiler output:
a.cc:53:8: error: explicit specialization of 'template<class _Tp> struct std::hash' outside its namespace must use a nested-name-specifier [-fpermissive]
   53 | struct hash<Data>
      |        ^~~~~~~~~~
Language: C++

#include<iostream>
#include<stack>
#include<queue>
#include<cstring>
#define INF 1 << 15
using namespace std;
struct d{
	int x;
	int y;
	int visited[12][12];
	int ic[144];
	int cnt;
};
struct b{
	int x;
	int y;
};
int main(){
	int lx,ly,i,j,nc=1,k,a,min=144,gx,gy,ex,ey;
	int maps[12][12]={0};
	int mx[4]={-1,0,1,0};
	int my[4]={0,-1,0,1};
	int ig[144]={0};
	int f[12][12];
	int mapc[13][13];
	char map[13][13];
	queue<b> q;
	b v,u;
	stack<d> s;
	d r,t;
	while(1){
		cin>>lx>>ly;
			if(lx==0&&ly==0){
				break;
			}
				memset(mapc,-1,sizeof(mapc));
			nc=1;
			memset(maps,0,sizeof(maps));
			memset(ig,0,sizeof(ig));
			min=144;
		for(i=0;i<ly;i++){
			cin>>map[i];
		}
		for(i=0;i<ly;i++){
			for(j=0;j<lx;j++){
					if(map[i][j]=='S'){
					r.x=j;
						r.y=i;
					memset(r.visited,0,sizeof(r.visited));
					memset(r.ic,0,sizeof(r.ic));
					r.cnt=0;
						mapc[i][j]=0;
					s.push(r);
				}
				if(map[i][j]=='G'){
					gx=j;
					gy=i;
				}
				if(map[i][j]=='X'&&maps[i][j]==0){
					v.x=j;
					v.y=i;
					q.push(v);
					while(!q.empty()){
						v=q.front();
						q.pop();
						maps[v.y][v.x]=nc;
						ig[nc]++;
						for(k=0;k<4;k++){
							u=v;
							u.x+=mx[k];
							u.y+=my[k];
							if(map[u.y][u.x]=='X'&&maps[u.y][u.x]==0&&u.x>=0&&u.x<lx&&u.y>=0&&u.y<ly){
								q.push(u);
								
							}
						}
					}
					if(ig[nc]==1){
						map[v.y][v.x]='#';
					}
					nc++;
					
				}
			}
		}
		v.x=gx;
		v.y=gy;
		
		memset(f,-1,sizeof(f));
		f[gy][gx]=0;
		q.push(v);
		while(!q.empty()){
			v=q.front();
			q.pop();
			for(i=0;i<4;i++){
				u=v;
				u.x+=mx[i];
				u.y+=my[i];
				if(map[u.y][u.x]!='#'&&u.x>=0&&u.x<lx&&u.y>=0&&u.y<ly&&f[u.y][u.x]==-1){
					q.push(u);
					f[u.y][u.x]=f[v.y][v.x]+1;
				}
			}
		}

		while(!s.empty()){
			r=s.top();
			s.pop();
			if(r.visited[r.y][r.x]==1){
				continue;
			}
			else{
				r.visited[r.y][r.x]=1;
			}
			if(r.cnt+f[r.y][r.x]>=min){
				continue;
			}
			
			for(i=0;i<4;i++){
				t=r;
				t.x+=mx[i];
				t.y+=my[i];
				t.cnt++;
				if(map[t.y][t.x]!='#'&&t.x>=0&&t.x<lx&&t.y>=0&&t.y<ly){
					
				if(mapc[t.y][t.x]>r.cnt+1||mapc[t.y][t.x]==-1){
						mapc[t.y][t.x]=r.cnt+1;
					}
					else{
						if(mapc[t.y][t.x]=<r.cnt){
						continue;
						}
					}
				if(map[t.y][t.x]=='G'&&t.cnt<min&&t.x>=0&&t.x<lx&&t.y>=0&&t.y<ly){
					ex=t.x;
					ey=t.y;
					min=t.cnt;
					break;
				}
				else if(r.visited[t.y][t.x]==0){
					
					if(map[t.y][t.x]=='X'){
						a=maps[t.y][t.x];
						t.ic[a]++;
						if(t.ic[a]<=(ig[a]/2)){
							s.push(t);
						}
					}
					else{
						s.push(t);
					}
				}
				}
			}
		}
		cout<<mapc[ey][ex]<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:130:67: error: expected primary-expression before '<' token
  130 |                                                 if(mapc[t.y][t.x]=<r.cnt){
      |                                                                   ^
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int W,H,SX,SY,GX,GY,ice_N;
int field[14][14],ice[14][14],icelife[1000];
bool flag[14][14];
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};
void dfs(int x, int y);
bool iddfs(int x, int y, int c);
int main(){
  while(cin >>W>>H,W||H){
    for(int i=0; i<14; i++){for(int j=0; j<14; j++){field[i][j] = 1;flag[i][j] = true;}}
    memset(ice,0,sizeof(ice));
    memset(icelife,0,sizeof(icelife));
    ice_N = 1;
    string s;
    int ans;
    for(int i=1; i<=H; i++){
      cin >>s;
      for(int j=1; j<=W; j++){
	if(s[j-1] == '.'){field[j][i] = 0;}
	if(s[j-1] == '#'){field[j][i] = 1;}
	if(s[j-1] == 'X'){field[j][i] = 2;}
	if(s[j-1] == 'S'){field[j][i] = 0;SX = j;SY = i;}
	if(s[j-1] == 'G'){field[j][i] = 0;GX = j;GY = i;}
      }
    }
    for(int i=1; i<=W; i++){
      for(int j=1; j<=H; j++){
	if(field[i][j] == 2 && ice[i][j] == 0){
	  dfs(i,j);
	  icelife[ice_N]/=2;
	  ice_N++;
	}
      }
    }
    for(ans = 0;;ans++){
      if(iddfs(SX,SY,ans)){cout <<ans+1<<endl;break;}
    }
  }
  return 0;
}
void dfs(int x, int y){
  ice[x][y] = ice_N;
  icelife[ice_N]++;
  for(int i=0; i<4; i++){
    int p = x+dx[i],q = y+dy[i];
    if(field[p][q] == 2 && ice[p][q] == 0){dfs(p,q);}
  }
}
bool iddfs(int x, int y, int c){
  bool f = false;
  if(x == GX && y == GY){return true;}
  if(c<0){return false;}
  for(int i=0; i<4; i++){
    int p = x+dx[i],q = y+dy[i];
    if(flag[p][q]){
      if(field[p][q] == 0){
	flag[p][q] = false;
	if(iddfs(p,q,c-1)){f = true;}
	flag[p][q] = true;
      }
      if(field[p][q] == 2){
	if(icelife[ice[p][q]]>0){
	  flag[p][q] = false;
	  icelife[ice[p][q]]--;
	  if(iddfs(p,q,c-1)){f = true;}
	  icelife[ice[p][q]]++;
	  flag[p][q] = true;
	}
      }
    }
  }
  return f;
}

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

#include<stdio.h>
 
int a(int n,int m,int k[30000]){
int i,j,sum,max;

 for(i=0;i<n;i++){

            sum=0;
            for(j=i;j<n;j++){
if(k[j]==0) continue;
                if(max==m-1) break;
                sum+=k[j];
sum%=m;
                if(max<sum) max=sum;
 
            }   
                if(max==m-1) break;
        }   
return max;
}

int main()
{
    int n,m,i,j;
    int k[30000];
 
    while(scanf("%d%d",&n,&m),n+m){
 
        max=0;
 
        for(i=0;i<n;i++){
            scanf("%d",&k[i]);
k[i]%=m;
        }   
 
      
 
        printf("%d\n",a(n,m,k));
    }   
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:29:9: error: 'max' undeclared (first use in this function)
   29 |         max=0;
      |         ^~~
main.c:29:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
 
int a(int n,int m,int k[30000]){
int i,j,sum,max=0;

 for(i=n-1;i>=0;i--){

            sum=0;
            for(j=i;j>=0;j--){
              if(k[j]==0) continue;
                if(max==m-1) break;
                sum+=k[j];
sum%=m;
                if(max<sum) max=sum;
 
            }   
                if(max==m-1) break;
        }   
return max;
}

int main()
{
    int n,m,i,j;
    int k[30000];
 
    while(scanf("%d%d",&n,&m),n+m){
 
        for(i=0;i<n;i++){
            scanf("%d",&k[i]);
            k[i]%=m;
sum+=k[i];
sum%=m;
if(sum==m-1) n=-1;
        }
if(n==-1){
printf("%d\n",sum);
continue;
}
 
        printf("%d\n",a(n,m,k));
    }   
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:32:1: error: 'sum' undeclared (first use in this function)
   32 | sum+=k[i];
      | ^~~
main.c:32:1: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<stdio.h>
 
int a(int n,int m,int k[30000]){
int i,j,sum,max;

 for(i=0;i<n;i++){

            sum=0;
            for(j=i;j<n;j++){
if(k[j]==0) continue;
                if(max==m-1) break;
                sum+=k[j];
sum%=m;
                if(max<sum) max=sum;
 
            }   
                if(max==m-1) break;
        }   
return max;
}

int main()
{
    int n,m,i,j;
    int k[30000];
 
    while(scanf("%d%d",&n,&m),n+m){
 
        max=0;
 
        for(i=0;i<n;i++){
            scanf("%d",&k[i]);
k[i]%=m;
        }   
 
      
 
        printf("%d\n",a(n,m,k));
    }   
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:9: error: 'max' was not declared in this scope
   29 |         max=0;
      |         ^~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

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

typedef long long ll;
int const inf = 1<<29;

int main() {

  for(int N, M; ~scanf("%d%d", &N, &M) && N;) {
    int sum[N + 1]; sum[0] = 0;

    int res = 0;
    rep(i, N) {
      int A; scanf("%d", &A); A %= M;
      sum[i + 1] = sum[i] + A;
      sum[i + 1] %= M;
      maximize(res, sum[i + 1]);
    }

    set<int> st = {M};

    REP(i, 1, N + 1) {
      maximize(res, sum[i] + M - *st.upper_bound(sum[i]));
      st.insert(sum[i]);
    }

    cout << res << endl;

  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:7: error: 'maximize' was not declared in this scope
   22 |       maximize(res, sum[i + 1]);
      |       ^~~~~~~~
a.cc:28:7: error: 'maximize' was not declared in this scope
   28 |       maximize(res, sum[i] + M - *st.upper_bound(sum[i]));
      |       ^~~~~~~~
Language: Java

import java.util.*;

class Main{
	private void compute(){
		Scanner sc = new Scanner(System.in);
		int sum = 0;
		for( int i = 0; i < 10; i++){
			int x =  sc.nextInt();
			sum += x;
		}
		System.out.println(sum);
		}
	}
	public static void main(String args[]){
		new Main().compute();
	}
	
}

Compiler output:
Main.java:14: error: unnamed classes are a preview feature and are disabled by default.
	public static void main(String args[]){
	              ^
  (use --enable-preview to enable unnamed classes)
Main.java:18: error: class, interface, enum, or record expected
}
^
2 errors
Language: Java

package hoge.hoge.com;
import java.util.Scanner;


public class HelloWorld {

	public static void main(String[] args) 
		throws java.io.IOException{
		// TODO 自動生成されたメソッド・スタブ


Scanner scan = new Scanner(System.in);
int i=0,a;
for(a=0;a<10;a++){
String str = scan.next();



i += Integer.parseInt(str);
}
System.out.println(+i\n);

	}
}

Compiler output:
Main.java:21: error: illegal character: '\'
System.out.println(+i\n);
                     ^
Main.java:21: error: not a statement
System.out.println(+i\n);
                      ^
Main.java:21: error: ';' expected
System.out.println(+i\n);
                       ^
3 errors
Language: Java

package hoge.hoge.com;
import java.util.Scanner;


public class HelloWorld {

	public static void main(String[] args) 
		throws java.io.IOException{
		// TODO 自動生成されたメソッド・スタブ


Scanner scan = new Scanner(System.in);
int i=0,a;
for(a=0;a<10;a++){
String str = scan.next();



i += Integer.parseInt(str);
}
System.out.println(+i);

	}
}

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


public class HelloWorld {
  public static void main (String[] args) {
    System.out.println("Hello World !!");
int i=0,a;
Scanner scan = new Scanner(System.in);
for(a=0;a<10;a++){
    String str = scan.next();
i += Integer.parseInt(str);
}
System.out.printfln(+i);
  }
}

Compiler output:
Main.java:2: error: class HelloWorld is public, should be declared in a file named HelloWorld.java
public class HelloWorld {
       ^
Main.java:6: error: cannot find symbol
Scanner scan = new Scanner(System.in);
^
  symbol:   class Scanner
  location: class HelloWorld
Main.java:6: error: cannot find symbol
Scanner scan = new Scanner(System.in);
                   ^
  symbol:   class Scanner
  location: class HelloWorld
Main.java:11: error: cannot find symbol
System.out.printfln(+i);
          ^
  symbol:   method printfln(int)
  location: variable out of type PrintStream
4 errors
Language: Java

public class sample{
public static void main(String[] args){
int i,a,g=0;
for(i=0;i<10;i++){
a=System.in.read();
g+=a;
}
System.out.println(g);
}
}

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

import java.io.*;
public class sample {
	public static void main(String[] args){
		try{
		int a,b,c=0;
		for(a=0;a<10;a++){
			b=System.in.read();
			c+=b;
		}
		System.out.println(c);
		}catch(IOException e){}
		
			
		}
	}

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

import java.util.Scanner;
class exe0256
{
public static void main(String args[])
{
Scanner scan=new Scanner(System.in);
sum=0;
for(int i=0;i<10;i++)
{
int s=scan.nextInt();
sum+=s;
}
System.out.println(sum);
}
}

Compiler output:
Main.java:7: error: cannot find symbol
sum=0;
^
  symbol:   variable sum
  location: class exe0256
Main.java:11: error: cannot find symbol
sum+=s;
^
  symbol:   variable sum
  location: class exe0256
Main.java:13: error: cannot find symbol
System.out.println(sum);
                   ^
  symbol:   variable sum
  location: class exe0256
3 errors
Language: Java

import java.util.Scanner;

public class aoj0256 {
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		int count = 0;
		for(int i = 0;i < 10;i++){
			int n = in.nextInt();
			count = count + n;
		}
		System.out.println(count);
	}
}

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

import java.util.Scanner;

public class J0256{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int sum=0;
		
		for(int i=0; i<10; i++){
			int n = sc.nextInt();	
			sum += n;
		}	
	
		System.out.println(sum);
	
	}
}

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.Scanner;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.Scanner;
      |            ^
main.c:3:1: error: unknown type name 'public'
    3 | public class J0256{
      | ^~~~~~
main.c:3:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'J0256'
    3 | public class J0256{
      |              ^~~~~
Language: C

#include<stdio.h>
int main(){
    int string[10];
    int i;
    int ans=0;
    for(i=0;i<=9i++){
        scanf("%d", &string[i]);
        ans+=string[i];
    }
    printf("%d\n",ans); 
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:18: error: lvalue required as increment operand
    6 |     for(i=0;i<=9i++){
      |                  ^~
main.c:6:20: error: expected ';' before ')' token
    6 |     for(i=0;i<=9i++){
      |                    ^
      |                    ;
Language: C

#include<stdio.h>
 
int main(){
    int a[10];
    int i;
    int ans=0;
    for(i=0;i<=9i++){
        scanf("%d", &a[i]);
        ans+=a[i];
    }
    printf("%d\n", ans); 
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:18: error: lvalue required as increment operand
    7 |     for(i=0;i<=9i++){
      |                  ^~
main.c:7:20: error: expected ';' before ')' token
    7 |     for(i=0;i<=9i++){
      |                    ^
      |                    ;
Language: C

#include <stdio.h>
int main(){
 int i,a[10],sum=0;

 for(i=0;i<10;i++){
  scanf("%d",&a[i]);
  sum+=a[i]
}

 printf("%d",sum);

 return 0;

}

Compiler output:
main.c: In function 'main':
main.c:7:12: error: expected ';' before '}' token
    7 |   sum+=a[i]
      |            ^
      |            ;
    8 | }
      | ~
Language: C

#include<stdio.h>
int main(void)
{
int a,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10;
scanf("%d %d %d %d %d %d %d %d %d %d"&s1,&s2,&s3,&s4,&s5,&s6,&s7,&s8,&s9,&s10);
a=s1+s2+s3+s4+s5+s6+s7+s8+s9+10;
printf("%d\n",a);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:38: error: invalid operands to binary & (have 'char *' and 'int')
    5 | scanf("%d %d %d %d %d %d %d %d %d %d"&s1,&s2,&s3,&s4,&s5,&s6,&s7,&s8,&s9,&s10);
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
      |       |
      |       char *
Language: C

#include<stdio.h>
int main(void)
{
int s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,a;
scanf("%d %d %d %d %d %d %d %d %d %d"&s1,&s2,&s3,&s4,&s5,&s6,&s7,&s8,&s9,&s10);
a=s1+s2+s3+s4+s5+s6+s7+s8+s9+10;
printf("%d\n",a);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:38: error: invalid operands to binary & (have 'char *' and 'int')
    5 | scanf("%d %d %d %d %d %d %d %d %d %d"&s1,&s2,&s3,&s4,&s5,&s6,&s7,&s8,&s9,&s10);
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
      |       |
      |       char *
Language: C

#include<stdio.h>
int main()
{
int s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,a;
scanf("%d %d %d %d %d %d %d %d %d %d"&s1,&s2,&s3,&s4,&s5,&s6,&s7,&s8,&s9,&s10);
a=s1+s2+s3+s4+s5+s6+s7+s8+s9+10;
printf("%d\n",a);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:38: error: invalid operands to binary & (have 'char *' and 'int')
    5 | scanf("%d %d %d %d %d %d %d %d %d %d"&s1,&s2,&s3,&s4,&s5,&s6,&s7,&s8,&s9,&s10);
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
      |       |
      |       char *
Language: C

#include<iostream>
using namespace std;


int main(){
	int ans=0;
	int tmp;
	for(int i=0;i<10;i++){
		cin>>tmp;
		ans+=tmp;
	}
	cout<<ans<<endl;
}

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

s;main(x){~scanf("%d",&x)?main(s+=x):exit(!printf("%d\n",s);}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | s;main(x){~scanf("%d",&x)?main(s+=x):exit(!printf("%d\n",s);}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
main.c:1:3: error: return type defaults to 'int' [-Wimplicit-int]
    1 | s;main(x){~scanf("%d",&x)?main(s+=x):exit(!printf("%d\n",s);}
      |   ^~~~
main.c: In function 'main':
main.c:1:3: error: type of 'x' defaults to 'int' [-Wimplicit-int]
main.c:1:12: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | s;main(x){~scanf("%d",&x)?main(s+=x):exit(!printf("%d\n",s);}
      |            ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | s;main(x){~scanf("%d",&x)?main(s+=x):exit(!printf("%d\n",s);}
main.c:1:12: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | s;main(x){~scanf("%d",&x)?main(s+=x):exit(!printf("%d\n",s);}
      |            ^~~~~
main.c:1:12: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:38: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
    1 | s;main(x){~scanf("%d",&x)?main(s+=x):exit(!printf("%d\n",s);}
      |                                      ^~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
  +++ |+#include <stdlib.h>
    1 | s;main(x){~scanf("%d",&x)?main(s+=x):exit(!printf("%d\n",s);}
main.c:1:38: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
    1 | s;main(x){~scanf("%d",&x)?main(s+=x):exit(!printf("%d\n",s);}
      |                                      ^~~~
main.c:1:38: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c:1:44: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    1 | s;main(x){~scanf("%d",&x)?main(s+=x):exit(!printf("%d\n",s);}
      |                                            ^~~~~~
main.c:1:44: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:44: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:44: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:60: error: expected ')' before ';' token
    1 | s;main(x){~scanf("%d",&x)?main(s+=x):exit(!printf("%d\n",s);}
      |                                          ~                 ^
      |                                                            )
main.c:1:61: error: expected ';' before '}' token
    1 | s;main(x){~scanf("%d",&x)?main(s+=x):exit(!printf("%d\n",s);}
      |                                                             ^
      |                                                             ;
Language: C

s;main(x){~scanf("%d",&x)?main(s+=x):x=!printf("%d\n",s);}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | s;main(x){~scanf("%d",&x)?main(s+=x):x=!printf("%d\n",s);}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
main.c:1:3: error: return type defaults to 'int' [-Wimplicit-int]
    1 | s;main(x){~scanf("%d",&x)?main(s+=x):x=!printf("%d\n",s);}
      |   ^~~~
main.c: In function 'main':
main.c:1:3: error: type of 'x' defaults to 'int' [-Wimplicit-int]
main.c:1:12: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | s;main(x){~scanf("%d",&x)?main(s+=x):x=!printf("%d\n",s);}
      |            ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | s;main(x){~scanf("%d",&x)?main(s+=x):x=!printf("%d\n",s);}
main.c:1:12: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | s;main(x){~scanf("%d",&x)?main(s+=x):x=!printf("%d\n",s);}
      |            ^~~~~
main.c:1:12: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:41: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    1 | s;main(x){~scanf("%d",&x)?main(s+=x):x=!printf("%d\n",s);}
      |                                         ^~~~~~
main.c:1:41: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:41: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:41: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:39: error: lvalue required as left operand of assignment
    1 | s;main(x){~scanf("%d",&x)?main(s+=x):x=!printf("%d\n",s);}
      |                                       ^
Language: C

#include<stdio.h>
int main()
{
int a,i,b=0;
for(i=0;i<10;i++){
scanf("%d",&a);
b+=a;
}

printf("%d\n";b);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:14: error: expected ')' before ';' token
   10 | printf("%d\n";b);
      |       ~      ^
      |              )
Language: C

#include <stdio.h>

int main(){
  int s, sum = 0;
  for(i	= 0; i < 10; i++){
    scanf("%d",	&s);
    sum += s;
  }

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

Compiler output:
main.c: In function 'main':
main.c:5:7: error: 'i' undeclared (first use in this function)
    5 |   for(i = 0; i < 10; i++){
      |       ^
main.c:5:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<stdio.h>
int main(){
  int i,sum=0,n;
  for(i=0;i<10;i++){
    cin >>n;
    sum+=n;
  }
  cout << sum<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope
    5 |     cin >>n;
      |     ^~~
a.cc:8:3: error: 'cout' was not declared in this scope
    8 |   cout << sum<<endl;
      |   ^~~~
a.cc:8:16: error: 'endl' was not declared in this scope
    8 |   cout << sum<<endl;
      |                ^~~~
Language: C++

import std.stream;
int main(){
int sum = 0;
for (i = 0; i < 10; i++){
   int a;
a = readIn;
sum += a;
}
writef(%d\n, sum);
}

Compiler output:
a.cc:9:10: error: stray '\' in program
    9 | writef(%d\n, sum);
      |          ^
a.cc:1:1: error: 'import' does not name a type
    1 | import std.stream;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc: In function 'int main()':
a.cc:4:6: error: 'i' was not declared in this scope
    4 | for (i = 0; i < 10; i++){
      |      ^
a.cc:6:5: error: 'readIn' was not declared in this scope
    6 | a = readIn;
      |     ^~~~~~
a.cc:9:8: error: expected primary-expression before '%' token
    9 | writef(%d\n, sum);
      |        ^
a.cc:9:9: error: 'd' was not declared in this scope
    9 | writef(%d\n, sum);
      |         ^
a.cc:9:1: error: 'writef' was not declared in this scope
    9 | writef(%d\n, sum);
      | ^~~~~~
Language: C++

import std.stdio;
void main()
{
    int a = 0;
    foreach(_; 0..10) {
        a += readln().chomp().to!int;
    }
 
    writeln(a);
}

Compiler output:
a.cc:5:16: error: too many decimal points in number
    5 |     foreach(_; 0..10) {
      |                ^~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import std.stdio;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: '::main' must return 'int'
    2 | void main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:5:13: error: '_' was not declared in this scope
    5 |     foreach(_; 0..10) {
      |             ^
a.cc:9:5: error: 'writeln' was not declared in this scope
    9 |     writeln(a);
      |     ^~~~~~~
Language: C++

import std.stdio;
 
void main()
{
    int sum = 0;
     
    for(uint = 0; i < 10; i++) {
        sum += readln().to!int;
    }
 
    writeln(sum);
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import std.stdio;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: '::main' must return 'int'
    3 | void main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:7:9: error: 'uint' was not declared in this scope; did you mean 'int'?
    7 |     for(uint = 0; i < 10; i++) {
      |         ^~~~
      |         int
a.cc:7:19: error: 'i' was not declared in this scope
    7 |     for(uint = 0; i < 10; i++) {
      |                   ^
a.cc:8:16: error: 'readln' was not declared in this scope
    8 |         sum += readln().to!int;
      |                ^~~~~~
a.cc:11:5: error: 'writeln' was not declared in this scope
   11 |     writeln(sum);
      |     ^~~~~~~
Language: C++

import std.stdio;
 
void main()
{
    int sum = 0;
     
    for(uint = 0; i < 10; i++) {
        sum += readln().to!int;
    }
 
    writef("%d\n",sum);

}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import std.stdio;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: '::main' must return 'int'
    3 | void main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:7:9: error: 'uint' was not declared in this scope; did you mean 'int'?
    7 |     for(uint = 0; i < 10; i++) {
      |         ^~~~
      |         int
a.cc:7:19: error: 'i' was not declared in this scope
    7 |     for(uint = 0; i < 10; i++) {
      |                   ^
a.cc:8:16: error: 'readln' was not declared in this scope
    8 |         sum += readln().to!int;
      |                ^~~~~~
a.cc:11:5: error: 'writef' was not declared in this scope
   11 |     writef("%d\n",sum);
      |     ^~~~~~
Language: C++

import std.stdio;
 
void main()
{
    int sum = 0;
     
    for(uint = 0; i < 10; i++) {
        sum += readln().chomp().to!int;
    }
 
    writef("%d\n",sum);

}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import std.stdio;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: '::main' must return 'int'
    3 | void main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:7:9: error: 'uint' was not declared in this scope; did you mean 'int'?
    7 |     for(uint = 0; i < 10; i++) {
      |         ^~~~
      |         int
a.cc:7:19: error: 'i' was not declared in this scope
    7 |     for(uint = 0; i < 10; i++) {
      |                   ^
a.cc:8:16: error: 'readln' was not declared in this scope
    8 |         sum += readln().chomp().to!int;
      |                ^~~~~~
a.cc:11:5: error: 'writef' was not declared in this scope
   11 |     writef("%d\n",sum);
      |     ^~~~~~
Language: C++

import std.stdio;
import std.array;
import std.string;

void main()
{
    int sum = 0;
     
    for(uint = 0; i < 10; i++) {
        sum += readln().chomp().to!int;
    }
 
    writef("%d\n",sum);

}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import std.stdio;
      | ^~~~~~
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 std.array;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import std.string;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: '::main' must return 'int'
    5 | void main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:9:9: error: 'uint' was not declared in this scope; did you mean 'int'?
    9 |     for(uint = 0; i < 10; i++) {
      |         ^~~~
      |         int
a.cc:9:19: error: 'i' was not declared in this scope
    9 |     for(uint = 0; i < 10; i++) {
      |                   ^
a.cc:10:16: error: 'readln' was not declared in this scope
   10 |         sum += readln().chomp().to!int;
      |                ^~~~~~
a.cc:13:5: error: 'writef' was not declared in this scope
   13 |     writef("%d\n",sum);
      |     ^~~~~~
Language: C++

import std.stdio;
import std.algorithm;
 
void main()
{
    int sum = 0;
     
    foreach(_; 0..10) {
        sum += readln().chomp().to!int;
    }
 
    writeln(sum);
}

Compiler output:
a.cc:8:16: error: too many decimal points in number
    8 |     foreach(_; 0..10) {
      |                ^~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import std.stdio;
      | ^~~~~~
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 std.algorithm;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: '::main' must return 'int'
    4 | void main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:8:13: error: '_' was not declared in this scope
    8 |     foreach(_; 0..10) {
      |             ^
a.cc:12:5: error: 'writeln' was not declared in this scope
   12 |     writeln(sum);
      |     ^~~~~~~
Language: C++

import std.stdio;
import std.array;
import std.range;
import std.string;
 
void main()
{
    int sum = 0;
     
    foreach(_; 0..10) {
        sum += readln().chomp().to!int;
    }
 
    writeln(sum);
}

Compiler output:
a.cc:10:16: error: too many decimal points in number
   10 |     foreach(_; 0..10) {
      |                ^~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import std.stdio;
      | ^~~~~~
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 std.array;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import std.range;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import std.string;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: '::main' must return 'int'
    6 | void main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:10:13: error: '_' was not declared in this scope
   10 |     foreach(_; 0..10) {
      |             ^
a.cc:14:5: error: 'writeln' was not declared in this scope
   14 |     writeln(sum);
      |     ^~~~~~~
Language: C++

import std.stdio;
import std.array;
import std.range;
import std.string;
import std.algorithm;
 
void main()
{
    int sum = 0;
     
    foreach(_; 0..10) {
        sum += readln().chomp().to!int;
    }
 
    writeln(sum);
}

Compiler output:
a.cc:11:16: error: too many decimal points in number
   11 |     foreach(_; 0..10) {
      |                ^~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import std.stdio;
      | ^~~~~~
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 std.array;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import std.range;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import std.string;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'import' does not name a type
    5 | import std.algorithm;
      | ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:1: error: '::main' must return 'int'
    7 | void main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:11:13: error: '_' was not declared in this scope
   11 |     foreach(_; 0..10) {
      |             ^
a.cc:15:5: error: 'writeln' was not declared in this scope
   15 |     writeln(sum);
      |     ^~~~~~~