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

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <utility>
#include <cmath>
#define INF 10000000
#define REP(i, n) for(int i = 0;i < (n);i++)
#define all(n) n.begin(),n.end()

using namespace std;

typedef long long int ll;
typedef pair<int, int> PII;

const int MAX_N = 1005;

int w, h, n;
int X1[MAX_N], X2[MAX_N], Y1[MAX_N], Y2[MAX_N];
bool fld[6*MAX_N][6*MAX_N];

int compress(int *x1, int *x2, int W){
	vector<int> xs;
	
	REP(i, n){
		for(int d = -1;d <= 1;d++){
			int tx1 = x1[i]+d, tx2 = x2[i]+d;
			if(0 <= tx1 && tx1 <= W*2) xs.push_back(tx1);
			if(0 <= tx2 && tx2 <= W*2) xs.push_back(tx2);
		}
	}

	sort(all(xs));
	xs.erase(unique(all(xs)), xs.end());

	REP(i, n){
		x1[i] = find(all(xs), x1[i]) - xs.begin();
		x2[i] = find(all(xs), x2[i]) - xs.begin();
	}
	return xs.size();
}
int dx[4] = {-1, 1, 0, 0};
int dy[4] = {0, 0, -1, 1};

int main(void){
	while(cin >> w >> h && w && h){
		cin >> n;
		REP(i, n){
			cin >> X1[i] >> Y1[i] >> X2[i] >> Y2[i];
			X1[i] = X1[i] * 2;
			X2[i] = X2[i] * 2;
			Y1[i] = Y1[i] * 2;
			Y2[i] = Y2[i] * 2;
		}

		memset(fld, 0, sizeof(fld));

		w = compress(X1, X2, w);
		h = compress(Y1, Y2, h);

		REP(i, n){
			for(int y = Y1[i];y <= Y2[i];y++){
				for(int x = X1[i];x <= X2[i];x++){
					fld[y][x] = true;
				}
			}
		}

		int res = 0;
		REP(y, h) REP(x, w){
			if(fld[y][x]) continue;
			res++;

			queue<PII> que;
			que.push(PII(y, x));
			while(!que.empty()){
				PII p = que.front(); que.pop();
				REP(i, 4){
					int tx = p.second + dx[i], ty = p.first + dy[i];
					if(tx < 0 || w <= tx || ty < 0 || h <= ty || fld[y][x]) continue;

					fld[y][x] = true;
					que.push(PII(y, x));
				}
			}
		}

		cout << res << endl;
	}
}

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

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <utility>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#define INF 10000000
#define REP(i, n) for(int i = 0;i < (n);i++)
#define all(n) n.begin(),n.end()

using namespace std;

typedef long long int ll;
typedef pair<int, int> PII;

const int MAX_N = 1005;

int w, h, n;
int X1[MAX_N], X2[MAX_N], Y1[MAX_N], Y2[MAX_N];
bool fld[6*MAX_N][6*MAX_N];

int compress(int *x1, int *x2, int W){
	vector<int> xs;
	
	REP(i, n){
		for(int d = -1;d <= 1;d++){
			int tx1 = x1[i]+d, tx2 = x2[i]+d;
			if(0 <= tx1 && tx1 <= W*2) xs.push_back(tx1);
			if(0 <= tx2 && tx2 <= W*2) xs.push_back(tx2);
		}
	}

	sort(all(xs));
	xs.erase(unique(all(xs)), xs.end());

	REP(i, n){
		x1[i] = find(all(xs), x1[i]) - xs.begin();
		x2[i] = find(all(xs), x2[i]) - xs.begin();
	}
	return xs.size();
}
int dx[4] = {-1, 1, 0, 0};
int dy[4] = {0, 0, -1, 1};

int main(void){
	while(cin >> w >> h && w && h){
		cin >> n;
		REP(i, n){
			cin >> X1[i] >> Y1[i] >> X2[i] >> Y2[i];
			X1[i] = X1[i] * 2;
			X2[i] = X2[i] * 2;
			Y1[i] = Y1[i] * 2;
			Y2[i] = Y2[i] * 2;
		}

		memset(fld, 0, sizeof(fld));

		w = compress(X1, X2, w);
		h = compress(Y1, Y2, h);

		REP(i, n){
			for(int y = Y1[i];y <= Y2[i];y++){
				for(int x = X1[i];x <= X2[i];x++){
					fld[y][x] = true;
				}
			}
		}

		int res = 0;
		REP(y, h) REP(x, w){
			if(fld[y][x]) continue;
			res++;

			queue<PII> que;
			que.push(PII(y, x));
			while(!que.empty()){
				PII p = que.front(); que.pop();
				REP(i, 4){
					int tx = p.second + dx[i], ty = p.first + dy[i];
					if(tx < 0 || w <= tx || ty < 0 || h <= ty || fld[y][x]) continue;

					fld[y][x] = true;
					que.push(PII(y, x));
				}
			}
		}

		cout << res << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:17: error: 'memset' was not declared in this scope
   59 |                 memset(fld, 0, sizeof(fld));
      |                 ^~~~~~
a.cc:10:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    9 | #include <cstdlib>
  +++ |+#include <cstring>
   10 | #define INF 10000000
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<stack>
#include<functional>
#include<list>
#include<unordered_map>
#define P pair<int,int>
using namespace std;

P x[1000], y[1000];
bool S[2005][2005];
int dx[4] = { -1,0,0,1 }, dy[4] = { 0,-1,1,0 };
int main() {
	int a, b;
	while (cin >> a >> b, a | b) {
		set<int>c[2];
		c[0].insert(0); c[0].insert(a);
		c[1].insert(0); c[0].insert(b);
		int d; cin >> d;
		for (int e = 0; e < d; e++) {
			int f, g, h, i; scanf("%d %d %d %d", &f, &g, &h, &i);
			c[0].insert(f); c[0].insert(h);
			c[1].insert(g); c[1].insert(i);
			x[e] = P(f, g);
			y[e] = P(h, i);
		}
		memset(S, 0, sizeof(S));
		int taiou[2][2005];
		unordered_map<int, int>U[2];
		auto e = c[0].begin();
		for (int f = 0; f < c[0].size(); e++, f++) {
			taiou[0][f] = *e;
			U[0][*e] = f;
		}
		e = c[1].begin();
		for (int f = 0; f < c[1].size(); e++, f++) {
			taiou[1][f] = *e;
			U[1][*e] = f;
		}
		for (int g = 0; g < d; g++) {
			for (int l = U[0][x[g].first]; l < U[0][y[g].first]; l++) {
				for (int r = U[1][x[g].second]; r < U[1][y[g].second]; r++) {
					S[l][r] = true;
				}
			}
		}
		int ans = 0;
		for (int i = 0; i+1 < c[0].size(); i++) {
			for (int j = 0; j+1 < c[1].size(); j++) {
				if (!S[i][j]) {
					ans++;
					queue<P>Q;
					Q.push(P(i,j));
					while (Q.size()) {
						P t = Q.front(); Q.pop();
						S[i][j] = true;
						for (int w = 0; w < 4; w++) {
							int n = t.first + dx[w], m = t.second + dy[w];
							if (n >= 0 && n+1 < c[0].size() && m >= 0 && m+1 < c[1].size() && !S[n][m]) {
								S[n][m] = true;
								Q.push(P(n, m));
							}
						}
					}
				}
			}
		}
		cout << ans << endl;
	}
}

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

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

int h, w, n;
int x[1000][2], y[1000][2];
vector<int> xs, ys, z;
bool a[2500][2500];
bool f[2500][2500];
long long int ans;
typedef pair<int, int> P;
int dx[4] = {0, 0, -1, 1};
int dy[4] = {-1, 1, 0, 0};

void dfs(int s, int t){
	if(a[s][t] || f[s][t]) return;
//	printf("%d %d\n", s, t);
	ans++;
	queue<P> q;
	q.push(P(s, t));
	while(!q.empty()){
		P p = q.front(); q.pop();
		f[p.first][p.second] = true;
		for(int i=0; i<4; i++){
			int nx = p.first+dx[i];
			int ny = p.second+dy[i];
			if(0 <= nx && 0 <= ny && nx < xs.size()-1 && ny < ys.size()-1)
				if(!a[nx][ny] && !f[nx][ny])
					q.push(P(nx, ny));
		}
	}
}

int main(){
	while(1){
		scanf("%d %d", &w, &h);
		if(w == 0 && h == 0) break;
		scanf("%d", &n);
		for(int i=0; i<n; i++) scanf("%d %d %d %d", &x[i][0], &y[i][0], &x[i][1], &y[i][1]);

		xs.push_back(0);
		ys.push_back(0);
		xs.push_back(w);
		ys.push_back(h);
		for(int i=0; i<n; i++){
			for(int j=0; j<2; j++){
				xs.push_back(x[i][j]);
				ys.push_back(y[i][j]);
			}
		}
		sort(xs.begin(), xs.end()); sort(ys.begin(), ys.end());
		xs.erase(unique(xs.begin(), xs.end()), xs.end());
		ys.erase(unique(ys.begin(), ys.end()), ys.end());
/*
		for(int i=0; i<xs.size(); i++) printf("%d\n", xs[i]);
		for(int i=0; i<ys.size(); i++) printf("%d\n", ys[i]);
*/
		for(int i=0; i<n; i++){
			for(int j=0; j<2; j++){
				x[i][j] = find(xs.begin(), xs.end(), x[i][j]) - xs.begin();
				y[i][j] = find(ys.begin(), ys.end(), y[i][j]) - ys.begin();
			}
		}
/*
		for(int i=0; i<n; i++){
			printf("%d %d %d %d\n", x[i][0], y[i][0], x[i][1], y[i][1]);
		}
*/
		memset(a, 0, sizeof(a));
		for(int i=0; i<n; i++){
			for(int j=x[i][0]; j<x[i][1]; j++){
				for(int k=y[i][0]; k<y[i][1]; k++){
					a[j][k] = true;
				}
			}
		}
/*
		for(int i=0; i<xs.size(); i++){
			for(int j=0; j<ys.size(); j++){
				if(a[i][j]) printf("1 ");
				else printf("0 ");
			}
			printf("\n");
		}
*/
//		printf("%lu %lu\n", xs.size(), ys.size());

		memset(f, 0, sizeof(f));
		ans = 0;
		for(int i=0; i<xs.size()-1; i++){
			for(int j=0; j<ys.size()-1; j++){
				dfs(i, j);
			}
		}

		printf("%lld\n", ans);
	}
}

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


#include<cstdio>
#include <iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<numeric>
using namespace std;
typedef long long ll;

typedef pair<int, int> P;

#define MAX_N 1010
int n;
bool f[2 * MAX_N + 6][2 * MAX_N + 6];

int cp(int *z1, int *z2, int k)
{
	vector<int> xs;
	for (int i = 0; i<n; i++) {
		xs.push_back(z1[i]);
		if (z1[i] - 1 >= 0)xs.push_back(z1[i] - 1);
		xs.push_back(z2[i] - 1);
		if (z2[i]<k)xs.push_back(z2[i]);
	}
	sort(xs.begin(), xs.end());
	xs.erase(unique(xs.begin(), xs.end()), xs.end());

	for (int i = 0; i<n; i++) {
		z1[i] = find(xs.begin(), xs.end(), z1[i]) - xs.begin();
		z2[i] = find(xs.begin(), xs.end(), z2[i]) - xs.begin();
	}

	return xs.size();
}

int main()
{
	int dx[4] = { 0,1,0,-1 };
	int dy[4] = { 1,0,-1,0 };
	int w, h;
	while (scanf("%d%d", &w, &h), w || h) {
		scanf("%d", &n);
		int x1[MAX_N + 1], x2[MAX_N + 1], y1[MAX_N + 1], y2[MAX_N + 1];
		for (int i = 0; i<n; i++) {
			scanf("%d%d%d%d", &x1[i], &y1[i], &x2[i], &y2[i]);
		}

		w = cp(x1, x2, w);
		h = cp(y1, y2, h);

		memset(f, 0, sizeof(f));
		for (int i = 0; i<n; i++) {
			for (int x = x1[i]; x<x2[i]; x++) {
				for (int y = y1[i]; y<y2[i]; y++) {
					f[x][y] = true;
				}
			}
		}

		int ans = 0;
		for (int i = 0; i<w; i++) {
			for (int j = 0; j<h; j++) {
				if (f[i][j])continue;
				ans++;

				queue<P> q;
				q.push(make_pair(i, j));
				f[i][j] = true;
				while (!q.empty()) {
					int x = q.front().first, y = q.front().second;
					q.pop();

					for (int l = 0; l<4; l++) {
						int xx = x + dx[l], yy = y + dy[l];
						if (xx<0 || xx >= w || yy<0 || yy >= h)continue;
						if (!f[xx][yy]) {
							q.push(make_pair(xx, yy));
							f[xx][yy] = true;
						}
					}
				}
			}
		}
		printf("%d\n", ans);
	}
	return 0;
}

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

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <fstream>
using namespace std;

const int MAX_N = 1000;
int X1[MAX_N], X2[MAX_N], Y1[MAX_N], Y2[MAX_N];
bool fld[MAX_N * 3][MAX_N * 3];

int W, H, N;

struct RECT
{
	int r, l, u, b;
};
int compress(int *x1, int *x2, int w);


int main()
{
	//ifstream ifs("data.txt");
	while( cin >> W >> H , W)
	{
		cin >> N;

		for(int i = 0; i < N; i++)
			cin >> X1[i] >> Y1[i] >> X2[i] >> Y2[i];
		
		W = compress(X1, X2, W);
		H = compress(Y1, Y2, H);

		memset(fld, 0, sizeof(fld));
		for(int i = 0; i < N; i++)
			for(int y = Y1[i]; y <= Y2[i]; y++)
				for(int x = X1[i]; x <= X2[i]; x++)
					fld[y][x] = true;

		int ans = 0;
		for(int y = 0; y < H; y++){
			for(int x = 0; x < W; x++){
				if(fld[y][x]) continue;
				ans++;

				queue<pair<int, int> > que;
				que.push(make_pair(x, y));
				while(!que.empty())
				{
					int sx = que.front().first, sy = que.front().second;
					que.pop();

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

					for(int i = 0; i < 4; i++)
					{
						int tx = sx + dx[i], ty = sy + dy[i];
						if(tx < 0 || W <= tx || ty < 0 || H <= ty) continue;
						if(fld[ty][tx]) continue;
						que.push(make_pair(tx, ty));
						fld[ty][tx] = true;
					}
				}

			}
		}
		cout << ans << endl;
	}
	//cin.sync(); cin.get();
}

int compress(int *x1, int *x2, int w)
{
	vector<int> xs;

	for(int i = 0; i < N; i++){
		for(int d = -1; d <= 1; d++)
		{
			int tx1 = x1[i] + d, tx2 = x2[i] + d;
			if(0 < tx1 && tx1 < W-1) xs.push_back(tx1);
			if(0 < tx2 && tx2 < W-1) xs.push_back(tx2);
		}
	}

	sort(xs.begin(), xs.end());
	xs.erase(unique(xs.begin(), xs.end()), xs.end());
	
	for(int i = 0; i < N; i++)
	{
		x1[i] = find(xs.begin(), xs.end(), x1[i]) - xs.begin();
		x2[i] = find(xs.begin(), xs.end(), x2[i]) - xs.begin();
	}
	
	return xs.size();
}

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

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

int W,H,N;
bool fld[6000][6000];
int X1[1000],X2[1000],Y1[1000],Y2[1000];
const int dx[4]={0,0,1,-1},dy[4]={1,-1,0,0};

int compress(int *x1,int *x2,int w){
	vector<int> xs;
	for(int i=0;i<N;i++){
		for(int j=-1;j<=1;j++){
			int tx1=x1[i]+j,tx2=x2[i]+j;
			if(1<=tx1 && tx1<=W)xs.push_back(tx1);
			if(1<=tx2 && tx2<=W)xs.push_back(tx2);
		}
	}
	sort(xs.begin(),xs.end());
	xs.erase(unique(xs.begin(),xs.end()),xs.end());
	for(int i=0;i<N;i++){
		x1[i]=find(xs.begin(),xs.end(),x1[i])-xs.begin();
		x2[i]=find(xs.begin(),xs.end(),x2[i])-xs.begin();
	}
	return xs.size();
}

void solve(){
	W=compress(X1,X2,W);
	H=compress(Y1,Y2,H);
	memset(fld,0,sizeof(fld));
	for(int i=0;i<N;i++){
		for(int y=Y1[i];y<=Y2[i];y++){
			for(int x=X1[i];x<=X2[i];x++){
				fld[y][x]=true;
			}
		}
	}
	int ans=0;
	for(int y=0;y<H;y++){
		for(int x=0;x<W;x++){
			if(fld[y][x])continue;
			ans++;

			queue<pair<int,int>> que;
			que.push(make_pair(x,y));
			while(!que.empty()){
				int sx=que.front().first,sy=que.front().second;
				que.pop();
				for(int i=0;i<4;i++){
					int tx=sx+dx[i],ty=sy+dy[i];
					if(tx<0 || W<=tx || ty<0 || H<=ty)continue;
					if(fld[ty][tx])continue;
					que.push(make_pair(tx,ty));
					fld[ty][tx]=true;
				}
			}
		}
	}
	printf("%d\n",ans);
}

int main(void){
	while(1){
		scanf("%d%d",&W,&H);
		if(W==0 && H==0)break;
		scanf("%d",&N);
		for(int i=0;i<N;i++){
			scanf("%d%d%d%d",&X1[i],&Y1[i],&X2[i],&Y2[i]);
		}
		solve();
	}
    return 0;
}

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

#include<algorithm>
#include<iostream>
#include<cstdio>
using namespace std;
struct P{
	int v,w,x,y;
};
bool pr(int* p,int* q){
	return *p<*q;
}
P a[1000];
int* x[2002],* y[2002];
char b[2003][2003];
void fi(int x,int y){
	static int dx[]={1,0,-1,0},dy[]={0,1,0,-1};
	int i;
	b[x][y]=-1;
	for(i=0;i<4;++i){
		if(!b[x+dx[i]][y+dy[i]])
			fi(x+dx[i],y+dy[i]);
	}
}	
int main(){
	int i,j,k;
	int w,h;
	while(scanf("%d%d",&w,&h),w||h){
		int n;
		scanf("%d",&n);
		for(i=0;i<n;++i){
			scanf("%d%d%d%d",&a[i].v,&a[i].w,&a[i].x,&a[i].y);
			x[i*2]=&a[i].v;
			x[i*2+1]=&a[i].x;
			y[i*2]=&a[i].w;
			y[i*2+1]=&a[i].y;
		}
		int z=0;
		x[i*2]=&z;
		x[i*2+1]=&w;
		y[i*2]=&z;
		y[i*2+1]=&h;
		sort(x,x+n*2+2,pr);
		sort(y,y+n*2+2,pr);
		for(i=1;i<n*2+2&&*x[0]==*x[i];++i);
		for(;i<n*2+2;i=j){
			for(j=i+1;j<n*2+2&&*x[i]==*x[j];++j);
			for(k=i;k<j;++k)
				*x[k]=*x[i-1]+1;
		}
		for(i=1;i<n*2+2&&*y[0]==*y[i];++i);
		for(;i<n*2+2;i=j){
			for(j=i+1;j<n*2+2&&*y[i]==*y[j];++j);
			for(k=i;k<j;++k)
				*y[k]=*y[i-1]+1;
		}
		memset(b,-1,sizeof(b));
		for(i=1;i<=w;++i)
			memset(b[i]+1,0,sizeof(char)*h);
		for(i=0;i<n;++i)
			for(j=a[i].v+1;j<=a[i].x;++j)
				memset(b[j]+a[i].w+1,-1,sizeof(char)*(a[i].y-a[i].w));
		int ct=0;
		for(i=1;i<=h;++i){
			for(j=1;j<=w;++j){
				if(b[j][i])
					continue;
				fi(j,i);
				++ct;
			}
		}
		printf("%d\n",ct);
	}
	return 0;
}

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

#include <cstdio>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
int w,h,n;
int x1[1005],x2[1005],y1[1005],y2[1005];
bool field[4005][4005]={};
int compress(int *x1,int *x2,int W){
	vector<int>xs;
	for(int i=0;i<n;i++){
		for(int d=-1;d<=1;d++){
			int ax=x1[i]+d;
			int bx=x2[i]+d;
			if(1<=ax && ax<=W) xs.push_back(ax);
			if(1<=bx && bx<=W) xs.push_back(bx);
		}
	}
	sort(xs.begin(),xs.end());
	xs.erase(unique(xs.begin(),xs.end()),xs.end());
	for(int i=0;i<n;i++){
		x1[i]=find(xs.begin(),xs.end(),x1[i])-xs.begin();
		x2[i]=find(xs.begin(),xs.end(),x2[i])-xs.begin();
	}
	return xs.size();
}
int main(){
	while(1){
	scanf("%d %d",&w,&h);
	if(!w) break;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d %d %d %d",&x1[i],&y1[i],&x2[i],&y2[i]);
	}
	w=compress(x1,x2,w);
	h=compress(y1,y2,h);
	memset(field,0,sizeof(field));
	for(int i=0;i<n;i++){
		for(int x=x1[i];x<=x2[i];x++){
			for(int y=y1[i];y<=y2[i];y++){
				field[x][y]=true;
			}
		}
	}
	int ans=0;
	int dx[4]={0,1,0,-1};
	int dy[4]={1,0,-1,0};
	for(int x=0;x<w;x++){
		for(int y=0;y<h;y++){
			if(field[x][y]) continue;
			ans++;
			queue<pair<int,int> >que;
			que.push(make_pair(x,y));
			while(!que.empty()){
				int ax=que.front().first;
				int ay=que.front().second;
				que.pop();
				for(int i=0;i<4;i++){
					int ro=ax+dx[i];
					int ryu=ay+dy[i];
					if(ro<0 || w<=ro || ryu<0 || h<=ryu){
						continue;
					}
					if(field[ro][ryu]) continue;
					que.push(make_pair(ro,ryu));
					field[ro][ryu]=true;
				}
			}
		}
	}
	printf("%d\n",ans);
	}
	return 0;
}

Compiler output:
a.cc:7:23: warning: built-in function 'y1' declared as non-function [-Wbuiltin-declaration-mismatch]
    7 | int x1[1005],x2[1005],y1[1005],y2[1005];
      |                       ^~
a.cc: In function 'int main()':
a.cc:37:9: error: 'memset' was not declared in this scope
   37 |         memset(field,0,sizeof(field));
      |         ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <queue>
  +++ |+#include <cstring>
    5 | using namespace std;
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<stack>

using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define all(n) n.begin(),n.end()
#define SIZE 2048

struct P{
  int x,y;
  P(int x1, int y1){
    x=x1,y=y1;
  }
};

int compress(vector<int> &x1, vector<int> &x2, int W){
  vector<int> xs;
  unsigned int size = x1.size();

  for(int i=0; i<size; i++){
    for(int d=-1; d<=1; d++){
      int tx1 = x1[i] + d, tx2 = x2[i] + d;
      if(0<=tx1 && tx1 <=W) xs.push_back(tx1);
      if(0<=tx2 && tx2 <=W) xs.push_back(tx2);
    }
  }

  sort(all(xs));
  xs.erase(unique(all(xs)), xs.end());
  int end = 0;

  for(int i=0; i<size; i++){
    x1[i] = find(all(xs), x1[i]) - xs.begin();
    x2[i] = find(all(xs), x2[i]) - xs.begin();
    if(end<x2[i])
      end = x2[i];
  }

  return xs.size()-1;
}

void dfs(bool Map[SIZE][SIZE], P start, int W, int H){
  static const int dx[] = {0, 0, -1, 1}, dy[] = {1, -1, 0, 0};
  stack<P> st;
  st.push(start);
  while(st.size()){
    P s = st.top();
    st.pop();
    rep(i, 4){
      P t = P(s.x+dx[i], s.y+dy[i]);
      if(t.y>=0 && t.x>=0 && t.y<H && t.x<W && Map[t.y][t.x]==false){
	Map[t.y][t.x]=true;
	st.push(t);
      }
    }
  }
}

bool board[SIZE][SIZE];

int main(){
  int W,H,N;
  while(cin>>W>>H, W|H){
    cin>>N;    
    vector<int> x1, x2, y1, y2;
    rep(i,N){
      int a, b, c, d;
      cin>>a>>b>>c>>d;
      x1.push_back(a);
      y1.push_back(b);
      x2.push_back(c);
      y2.push_back(d);
    }

    W = compress(x1, x2, W);
    H = compress(y1, y2, H);
    memset(board, 0, sizeof(board));
    rep(i, N){
      for(int y=y1[i]; y<y2[i]; y++){
	memset(board[y]+x1[i], 1, x2[i]-x1[i]);
      }
    }

    int count = 0;
    rep(y, H){
      rep(x, W){
	if(board[y][x]==false){
	  count++;
	  dfs(board, P(x, y), W, H);
	}
      }
    }
    cout << count << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:79:5: error: 'memset' was not declared in this scope
   79 |     memset(board, 0, sizeof(board));
      |     ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<stack>
  +++ |+#include <cstring>
    5 |
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UncheckedIOException;
import java.util.StringTokenizer;

class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		while(!sc.hasNext()) {
			int sh=sc.nextInt();
			int sm=sc.nextInt();
			int ss=sc.nextInt();
			int gh=sc.nextInt();
			int gm=sc.nextInt();
			int gs=sc.nextInt();
			int zan=(gh*3600+gm*60+gs)-(sh*3600+sm*60+ss);
			pl(zan/3600+" "+(zan%3600)/60+" "+zan%60);
		}
	}
	public static void pl(Object o) {
		System.out.println(o);
	}
	public static void pl() {
		System.out.println();
	}
	public static void p(Object o) {
		System.out.print(o);
	}
	static class SC {
		private BufferedReader reader = null;
		private StringTokenizer tokenizer = null;
		public SC(InputStream in) {
			reader = new BufferedReader(new InputStreamReader(in));
		}
		public String next() {
			if (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
			}
			return tokenizer.nextToken();
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		public double nextDouble() {
			return Double.parseDouble(next());
		}
		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new UncheckedIOException(e);
			}
		}
	}
}


Compiler output:
Main.java:10: error: cannot find symbol
		Scanner sc=new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:10: error: cannot find symbol
		Scanner sc=new Scanner(System.in);
		               ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UncheckedIOException;
import java.util.StringTokenizer;

class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		while(sc.hasNext()) {
			int sh=sc.nextInt();
			int sm=sc.nextInt();
			int ss=sc.nextInt();
			int gh=sc.nextInt();
			int gm=sc.nextInt();
			int gs=sc.nextInt();
			int zan=(gh*3600+gm*60+gs)-(sh*3600+sm*60+ss);
			pl(zan/3600+" "+(zan%3600)/60+" "+zan%60);
		}
	}
	public static void pl(Object o) {
		System.out.println(o);
	}
	public static void pl() {
		System.out.println();
	}
	public static void p(Object o) {
		System.out.print(o);
	}
	static class SC {
		private BufferedReader reader = null;
		private StringTokenizer tokenizer = null;
		public SC(InputStream in) {
			reader = new BufferedReader(new InputStreamReader(in));
		}
		public String next() {
			if (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
			}
			return tokenizer.nextToken();
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		public double nextDouble() {
			return Double.parseDouble(next());
		}
		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new UncheckedIOException(e);
			}
		}
	}
}


Compiler output:
Main.java:10: error: cannot find symbol
		Scanner sc=new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:10: error: cannot find symbol
		Scanner sc=new Scanner(System.in);
		               ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

import java.util.*;

class Main{
	public static void main(String[] args){
		Solve s = new Solve();
		s.solve();
	}	
}

class Solve{
	Solve(){}
	
	Scanner in = new Scanner(System.in);

	void solve(){
		int h1,m1,s1,h2,m2,s2;
		for(int i = 0; i < 3; i++){
			h1 = in.nextInt();
			m1 = in.nextInt();
			s1 = in.nextInt();
			h2 = in.nextInt();
			s2 = in.nextInt();
			m2 = in.nextInt();

			int a = tos(h2,s2,m2) - tos(h1,s1,m1);
			System.out.print(a/3600);
			a %= 3600;
			System.out.print(" ");
			System.out.print(a / 60);
			a %= 60;
			System.out.print(" ");
			System.out.println(a);
		}

	}

	int tos(int h, int m, int s){
		int ret = 0;
		ret += h * 3600;
		ret += m *60;
		ret += s;
	}

}

Compiler output:
Main.java:42: error: missing return statement
	}
	^
1 error
Language: Java

Scanner scan = new Scanner(System.in);
int[6] h,m,s;
for(int i=0;i<6;i++){
h[i] = scan.next();
m[i] = scan.next();
s[i] = scan.next();
}
for(int i=1;i<6;i+=2){
if((s[i]-=s[i-1])<0){s[i]=60-s[i];m[i]-=1;}
if((m[i]-=m[i-1])<0){m[i]=60-b[i];h[i]-=1;}
h[i]-=h[i-1];
}
for(int i=1;i<6;i+=2){
System.out.println(h[i]+" "+m[i]+" "+s[i]);
}

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
Scanner scan = new Scanner(System.in);
^
  (use --enable-preview to enable unnamed classes)
Main.java:2: error: class, interface, enum, or record expected
int[6] h,m,s;
^
Main.java:3: error: class, interface, enum, or record expected
for(int i=0;i<6;i++){
^
Main.java:3: error: class, interface, enum, or record expected
for(int i=0;i<6;i++){
            ^
Main.java:3: error: class, interface, enum, or record expected
for(int i=0;i<6;i++){
                ^
Main.java:5: error: class, interface, enum, or record expected
m[i] = scan.next();
^
Main.java:6: error: class, interface, enum, or record expected
s[i] = scan.next();
^
Main.java:7: error: class, interface, enum, or record expected
}
^
Main.java:8: error: class, interface, enum, or record expected
for(int i=1;i<6;i+=2){
            ^
Main.java:8: error: class, interface, enum, or record expected
for(int i=1;i<6;i+=2){
                ^
Main.java:9: error: class, interface, enum, or record expected
if((s[i]-=s[i-1])<0){s[i]=60-s[i];m[i]-=1;}
                                  ^
Main.java:9: error: class, interface, enum, or record expected
if((s[i]-=s[i-1])<0){s[i]=60-s[i];m[i]-=1;}
                                          ^
Main.java:10: error: class, interface, enum, or record expected
if((m[i]-=m[i-1])<0){m[i]=60-b[i];h[i]-=1;}
                                  ^
Main.java:10: error: class, interface, enum, or record expected
if((m[i]-=m[i-1])<0){m[i]=60-b[i];h[i]-=1;}
                                          ^
Main.java:12: error: class, interface, enum, or record expected
}
^
Main.java:13: error: class, interface, enum, or record expected
for(int i=1;i<6;i+=2){
            ^
Main.java:13: error: class, interface, enum, or record expected
for(int i=1;i<6;i+=2){
                ^
Main.java:15: error: class, interface, enum, or record expected
}
^
18 errors
Language: Java

import java.util.Scanner;
class AOJ0532{
public static void main(String args[]){
Scanner scan = new Scanner(System.in);
int[6] h,m,s;
for(int i=0;i<6;i++){
h[i] = scan.next();
m[i] = scan.next();
s[i] = scan.next();
}
for(int i=1;i<6;i+=2){
if((s[i]-=s[i-1])<0){s[i]=60-s[i];m[i]-=1;}
if((m[i]-=m[i-1])<0){m[i]=60-b[i];h[i]-=1;}
h[i]-=h[i-1];
}
for(int i=1;i<6;i+=2){
System.out.println(h[i]+" "+m[i]+" "+s[i]);
}
}
}

Compiler output:
Main.java:5: error: ']' expected
int[6] h,m,s;
    ^
Main.java:5: error: not a statement
int[6] h,m,s;
   ^
Main.java:5: error: not a statement
int[6] h,m,s;
       ^
Main.java:5: error: ';' expected
int[6] h,m,s;
        ^
Main.java:5: error: not a statement
int[6] h,m,s;
         ^
Main.java:5: error: ';' expected
int[6] h,m,s;
          ^
Main.java:5: error: not a statement
int[6] h,m,s;
           ^
7 errors
Language: Java

import java.util.Scanner;

class Main{
   public static void main(String args[]){
      Scanner scan = new Scanner(System.in);
      int[6] h,m,s;
      for(int i=0;i<6;i++){
         h[i] = scan.next();
         m[i] = scan.next();
         s[i] = scan.next();
      }
      for(int i=1;i<6;i+=2){
         if((s[i]-=s[i-1])<0){s[i]=60-s[i];m[i]-=1;}
         if((m[i]-=m[i-1])<0){m[i]=60-b[i];h[i]-=1;}
         h[i]-=h[i-1];
      }
      for(int i=1;i<6;i+=2){
      System.out.println(h[i]+" "+m[i]+" "+s[i]);
      }
   }
}

Compiler output:
Main.java:6: error: ']' expected
      int[6] h,m,s;
          ^
Main.java:6: error: not a statement
      int[6] h,m,s;
         ^
Main.java:6: error: not a statement
      int[6] h,m,s;
             ^
Main.java:6: error: ';' expected
      int[6] h,m,s;
              ^
Main.java:6: error: not a statement
      int[6] h,m,s;
               ^
Main.java:6: error: ';' expected
      int[6] h,m,s;
                ^
Main.java:6: error: not a statement
      int[6] h,m,s;
                 ^
7 errors
Language: Java

import java.util.Scanner;

class Main{
   public static void main(String args[]){
      Scanner scan = new Scanner(System.in);
      int[6] h;int[6] m;int[6] s;
      for(int i=0;i<6;i++){
         h[i] = scan.next();
         m[i] = scan.next();
         s[i] = scan.next();
      }
      for(int i=1;i<6;i+=2){
         if((s[i]-=s[i-1])<0){s[i]=60-s[i];m[i]-=1;}
         if((m[i]-=m[i-1])<0){m[i]=60-b[i];h[i]-=1;}
         h[i]-=h[i-1];
      }
      for(int i=1;i<6;i+=2){
      System.out.println(h[i]+" "+m[i]+" "+s[i]);
      }
   }
}

Compiler output:
Main.java:6: error: ']' expected
      int[6] h;int[6] m;int[6] s;
          ^
Main.java:6: error: not a statement
      int[6] h;int[6] m;int[6] s;
         ^
Main.java:6: error: not a statement
      int[6] h;int[6] m;int[6] s;
             ^
Main.java:6: error: ']' expected
      int[6] h;int[6] m;int[6] s;
                   ^
Main.java:6: error: not a statement
      int[6] h;int[6] m;int[6] s;
                  ^
Main.java:6: error: not a statement
      int[6] h;int[6] m;int[6] s;
                      ^
Main.java:6: error: ']' expected
      int[6] h;int[6] m;int[6] s;
                            ^
Main.java:6: error: not a statement
      int[6] h;int[6] m;int[6] s;
                           ^
Main.java:6: error: not a statement
      int[6] h;int[6] m;int[6] s;
                               ^
9 errors
Language: Java

import java.util.Scanner;

class Main{
   public static void main(String args[]){
      Scanner scan = new Scanner(System.in);
      int[] h　= new int[6];
      int[] m　= new int[6];
      int[] s　= new int[6];
      for(int i=0;i<6;i++){
         h[i] = scan.next();
         m[i] = scan.next();
         s[i] = scan.next();
      }
      for(int i=1;i<6;i+=2){
         if((s[i]-=s[i-1])<0){s[i]=60-s[i];m[i]-=1;}
         if((m[i]-=m[i-1])<0){m[i]=60-b[i];h[i]-=1;}
         h[i]-=h[i-1];
      }
      for(int i=1;i<6;i+=2){
      System.out.println(h[i]+" "+m[i]+" "+s[i]);
      }
   }
}

Compiler output:
Main.java:6: error: illegal character: '\u3000'
      int[] h?= new int[6];
             ^
Main.java:6: error: not a statement
      int[] h?= new int[6];
                ^
Main.java:7: error: illegal character: '\u3000'
      int[] m?= new int[6];
             ^
Main.java:7: error: not a statement
      int[] m?= new int[6];
                ^
Main.java:8: error: illegal character: '\u3000'
      int[] s?= new int[6];
             ^
Main.java:8: error: not a statement
      int[] s?= new int[6];
                ^
6 errors
Language: Java

import java.util.Scanner;

class Main{
   public static void main(String args[]){
      Scanner scan = new Scanner(System.in);
      h　= new int[6];
      m　= new int[6];
      s　= new int[6];
      for(int i=0;i<6;i++){
         h[i] = scan.next();
         m[i] = scan.next();
         s[i] = scan.next();
      }
      for(int i=1;i<6;i+=2){
         if((s[i]-=s[i-1])<0){s[i]=60-s[i];m[i]-=1;}
         if((m[i]-=m[i-1])<0){m[i]=60-b[i];h[i]-=1;}
         h[i]-=h[i-1];
      }
      for(int i=1;i<6;i+=2){
      System.out.println(h[i]+" "+m[i]+" "+s[i]);
      }
   }
}

Compiler output:
Main.java:6: error: illegal character: '\u3000'
      h?= new int[6];
       ^
Main.java:6: error: not a statement
      h?= new int[6];
      ^
Main.java:6: error: not a statement
      h?= new int[6];
          ^
Main.java:7: error: illegal character: '\u3000'
      m?= new int[6];
       ^
Main.java:7: error: not a statement
      m?= new int[6];
      ^
Main.java:7: error: not a statement
      m?= new int[6];
          ^
Main.java:8: error: illegal character: '\u3000'
      s?= new int[6];
       ^
Main.java:8: error: not a statement
      s?= new int[6];
      ^
Main.java:8: error: not a statement
      s?= new int[6];
          ^
9 errors
Language: Java

import java.util.Scanner;

class Main{
   public static void main(String args[]){
      Scanner scan = new Scanner(System.in);
      int h[]　= new int[6];
      int m[]　= new int[6];
      int s[]　= new int[6];
      for(int i=0;i<6;i++){
         h[i] = scan.next();
         m[i] = scan.next();
         s[i] = scan.next();
      }
      for(int i=1;i<6;i+=2){
         if((s[i]-=s[i-1])<0){s[i]=60-s[i];m[i]-=1;}
         if((m[i]-=m[i-1])<0){m[i]=60-b[i];h[i]-=1;}
         h[i]-=h[i-1];
      }
      for(int i=1;i<6;i+=2){
      System.out.println(h[i]+" "+m[i]+" "+s[i]);
      }
   }
}

Compiler output:
Main.java:6: error: illegal character: '\u3000'
      int h[]?= new int[6];
             ^
Main.java:6: error: not a statement
      int h[]?= new int[6];
                ^
Main.java:7: error: illegal character: '\u3000'
      int m[]?= new int[6];
             ^
Main.java:7: error: not a statement
      int m[]?= new int[6];
                ^
Main.java:8: error: illegal character: '\u3000'
      int s[]?= new int[6];
             ^
Main.java:8: error: not a statement
      int s[]?= new int[6];
                ^
6 errors
Language: Java

import java.util.Scanner;

class Main{
   public static void main(String args[]){
      Scanner scan = new Scanner(System.in);
      int[] h,m,s;
      h　= new int[6];
      m　= new int[6];
      s　= new int[6];
      for(int i=0;i<6;i++){
         h[i] = scan.next();
         m[i] = scan.next();
         s[i] = scan.next();
      }
      for(int i=1;i<6;i+=2){
         if((s[i]-=s[i-1])<0){s[i]=60-s[i];m[i]-=1;}
         if((m[i]-=m[i-1])<0){m[i]=60-b[i];h[i]-=1;}
         h[i]-=h[i-1];
      }
      for(int i=1;i<6;i+=2){
      System.out.println(h[i]+" "+m[i]+" "+s[i]);
      }
   }
}

Compiler output:
Main.java:7: error: illegal character: '\u3000'
      h?= new int[6];
       ^
Main.java:7: error: not a statement
      h?= new int[6];
      ^
Main.java:7: error: not a statement
      h?= new int[6];
          ^
Main.java:8: error: illegal character: '\u3000'
      m?= new int[6];
       ^
Main.java:8: error: not a statement
      m?= new int[6];
      ^
Main.java:8: error: not a statement
      m?= new int[6];
          ^
Main.java:9: error: illegal character: '\u3000'
      s?= new int[6];
       ^
Main.java:9: error: not a statement
      s?= new int[6];
      ^
Main.java:9: error: not a statement
      s?= new int[6];
          ^
9 errors
Language: Java

import java.util.Scanner;

class public Main{
   public static void main(String args[]){
      Scanner scan = new Scanner(System.in);
      int[] h,m,s;
      h　= new int[6];
      m　= new int[6];
      s　= new int[6];
      for(int i=0;i<6;i++){
         h[i] = scan.next();
         m[i] = scan.next();
         s[i] = scan.next();
      }
      for(int i=1;i<6;i+=2){
         if((s[i]-=s[i-1])<0){s[i]=60-s[i];m[i]-=1;}
         if((m[i]-=m[i-1])<0){m[i]=60-b[i];h[i]-=1;}
         h[i]-=h[i-1];
      }
      for(int i=1;i<6;i+=2){
      System.out.println(h[i]+" "+m[i]+" "+s[i]);
      }
   }
}

Compiler output:
Main.java:3: error: <identifier> expected
class public Main{
     ^
Main.java:3: error: class, interface, enum, or record expected
class public Main{
             ^
Main.java:7: error: illegal character: '\u3000'
      h?= new int[6];
       ^
Main.java:7: error: not a statement
      h?= new int[6];
      ^
Main.java:7: error: not a statement
      h?= new int[6];
          ^
Main.java:8: error: illegal character: '\u3000'
      m?= new int[6];
       ^
Main.java:8: error: not a statement
      m?= new int[6];
      ^
Main.java:8: error: not a statement
      m?= new int[6];
          ^
Main.java:9: error: illegal character: '\u3000'
      s?= new int[6];
       ^
Main.java:9: error: not a statement
      s?= new int[6];
      ^
Main.java:9: error: not a statement
      s?= new int[6];
          ^
Main.java:4: 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:24: error: class, interface, enum, or record expected
}
^
13 errors
Language: C

#include <stdio.h>

int main(){
int sh,sm,ss,th,tm,ts,h,m,s,ks,ps,x;

for (i = 1;i <= 3;i++){

scanf("%d %d %d %d %d %d",&sh,&sm,&ss,&th,&tm,&ts);

ks = sh*60*60+sm*60+ss;
ps = th*60*60+tm*60+ts;

x=ps-ks;

h=x/3600;
m=(x-h*3600)/60;
s=x-h*3600-m*60;
}
return0;
}

Compiler output:
main.c: In function 'main':
main.c:6:6: error: 'i' undeclared (first use in this function)
    6 | for (i = 1;i <= 3;i++){
      |      ^
main.c:6:6: note: each undeclared identifier is reported only once for each function it appears in
main.c:19:1: error: 'return0' undeclared (first use in this function)
   19 | return0;
      | ^~~~~~~
Language: C

#include <stdio.h>

int main(){
int sh,sm,ss,th,tm,ts,h,m,s,ks,ps,x,i;

for (i = 1;i <= 3;i++){

scanf("%d %d %d %d %d %d",&sh,&sm,&ss,&th,&tm,&ts);

ks = sh*60*60+sm*60+ss;
ps = th*60*60+tm*60+ts;

x=ps-ks;

h=x/3600;
m=(x-h*3600)/60;
s=x-h*3600-m*60;
}
return0;
}

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

#include <stdio.h>

int main()
{
	int ah, am, as, bh, bm, bs, h, m, s;
	scanf_s("%d%d%d", &ah, &am, &as);
	as = 3600 * ah + 60 * am + as;
	scanf_s("%d%d%d", &bh, &bm, &bs);
	bs = bh * 3600 + bm * 60 + bs;

	h = (bs - as) / 3600;
	m = ((bs - as) % 3600) / 60;
	s = ((bs - as) % 3600) % 60;
	printf("%d %d %d", h, m, s);

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    6 |         scanf_s("%d%d%d", &ah, &am, &as);
      |         ^~~~~~~
      |         scanf
Language: C

#include <stdio.h>
int main(){
int h[3][2],m[3][2],s[3][2],i,k,koh[3],kom[3],kos[3];

for(k=0;k<3;k++){
scanf("%d %d %d %d %d %d",&h[k][0],&m[k][0],&s[k][0],&h[k][1],&m[k][1],&s[k][1]);
if(k<=2){printf("\n");}}
for(i=0;i<3;i++){



    if(s[i][0]<=s[i][1]){
        kos[i]=s[i][1]-s[i][0];
    }
    else{kos[i]=s[i][1]+60-s[i][0]; kom[i]--;}

    if(m[i][0]<=m[i][1]){
        kom[i]=m[i][1]-m[i][0];
    }
    else{kom[i]=m[i][1]+60-m[i][0]; koh[i]--;}


    koh[i]=h[i][1]-h[i][0];

prinf("%d %d %d\n",koh[i],kom[i],kos[i]);
}




return 0;
}

Compiler output:
main.c: In function 'main':
main.c:25:1: error: implicit declaration of function 'prinf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   25 | prinf("%d %d %d\n",koh[i],kom[i],kos[i]);
      | ^~~~~
      | printf
Language: C

#include "stdafx.h"
#include "stdio.h"

typedef struct {
	int Arrive[3];
	int Leave[3];
}Time;

void timecal(int arrive[3], int leave[3], int result[3])
{
	int temp;
	for (temp = 2; temp > 0; temp--) {
		result[temp] = (leave[temp] - arrive[temp]);
		if (result[temp] < 0) {
			result[temp] = 60 + result[temp];
			leave[temp - 1]--;
		}

		result[0] = leave[0] - arrive[0];
	}
}

int main(void) {
	int temp;
	int res1[3], res2[3], res3[3];
	Time A;
	Time B;
	Time C;
	for (temp = 0; temp < 3; temp++)
	{
		scanf("%d", &A.Arrive[temp]);

	}	
	for (temp = 0; temp < 3; temp++) {
		scanf("%d", &A.Leave[temp]);
	}
	for (temp = 0; temp < 3; temp++)
	{
		scanf("%d", &B.Arrive[temp]);
	}
	for (temp = 0; temp < 3; temp++) {
		scanf("%d", &B.Leave[temp]);
	}
	for (temp = 0; temp < 3; temp++)
	{
		scanf("%d", &C.Arrive[temp]);
	}
	for (temp = 0; temp < 3; temp++) {
		scanf("%d", &C.Leave[temp]);
	}
	timecal(A.Arrive, A.Leave,res1);
	printf("%d%d%d", res1[0], res1[1], res1[2]);
	timecal(B.Arrive, B.Leave,res2);
	printf("%d%d%d", res2[0], res2[1], res2[2]);
	timecal(C.Arrive, C.Leave,res3);
	printf("%d%d%d", res3[0], res3[1], res3[2]);
	return 0;
	}

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

#include <stdio.h>
  int main(){
     int h1[3],m1[3],s1[3];
      int h2[3],m2[3],s2[3];
       int h[3],m[3],s[3];
       int i;
         for(i=0;i<3;i++){
            scanf("%d%d%d%d%d%d",&h1[i],&m1[i],&s1[i]",&h2[i],&m2[i],&s2[i]);
              }
          for(i=0;i<3;i++){
             int x[3];
             int y[3];
             y[i]=h2[i]*3600+m2[i]*60+s2[i];
             x[i]=h1[i]*3600+m1[i]*60+s1[i];
             int z[3];
             z[i]=y[i]-x[i];
             h[i]=z[i]/3600;
             z[i] -= h[i]*3600;
              m[i] = z[i]/60;
              z[i] -= m[i]*60;
              s[i] = z[i];
               printf("%d%d%d\n",h[i],m[i],s[i]);
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:54: warning: missing terminating " character
    8 |             scanf("%d%d%d%d%d%d",&h1[i],&m1[i],&s1[i]",&h2[i],&m2[i],&s2[i]);
      |                                                      ^
main.c:8:54: error: missing terminating " character
    8 |             scanf("%d%d%d%d%d%d",&h1[i],&m1[i],&s1[i]",&h2[i],&m2[i],&s2[i]);
      |                                                      ^~~~~~~~~~~~~~~~~~~~~~~~
main.c:8:54: error: expected ')' before '}' token
    8 |             scanf("%d%d%d%d%d%d",&h1[i],&m1[i],&s1[i]",&h2[i],&m2[i],&s2[i]);
      |                  ~                                   ^
      |                                                      )
    9 |               }
      |               ~                                       
main.c:8:54: error: expected ';' before '}' token
    8 |             scanf("%d%d%d%d%d%d",&h1[i],&m1[i],&s1[i]",&h2[i],&m2[i],&s2[i]);
      |                                                      ^
      |                                                      ;
    9 |               }
      |               ~
Language: C

#include<stdio.h>

int main(){
	int a;
	int b;
	int c;
	scanf("%d", &a);
	scanf("%d", &b);
	scanf("%d", &c);
	if(b1 == 1){
		if(b2 == 1){
			printf("Open\n");
		}else{
			printf("Close\n");
		}
	}else{
		if(b3 == 1){
			printf("Open\n");
		}else{
			printf("Close\n");
		}
	}
	return 0;

}

Compiler output:
main.c: In function 'main':
main.c:10:12: error: 'b1' undeclared (first use in this function); did you mean 'b'?
   10 |         if(b1 == 1){
      |            ^~
      |            b
main.c:10:12: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:20: error: 'b2' undeclared (first use in this function); did you mean 'b'?
   11 |                 if(b2 == 1){
      |                    ^~
      |                    b
main.c:17:20: error: 'b3' undeclared (first use in this function); did you mean 'b'?
   17 |                 if(b3 == 1){
      |                    ^~
      |                    b
Language: C

#include <stdio.h>

int main(){
int toki[3],tokide[3],fun[3],funde[3],byou[3],byoude[3];
int i,f,t;
int kekkat[3],kekkaf[3],kekkab[3];

for(i=0;i<3;i++){
scanf("%d %d %d %d %d %d",&toki[i],&fun[i],&byou[i],&tokide[i],&funde[i],&byoude[i]);
}
for(i=0;i<3;i++){
f=0;
t=0;
kekkab[i]=byoude[i]-byou[i];
if(kekkab[i]<0){
kekkab[i]=60+kekkab[i];
f++;
}
kekkaf[i]=funde[i]-fun[i]-f;
if(kakkaf[i]<0){
kekkaf[i]=60+kakkaf[i];
t++;
}
kekkat[i]=tokide[i]-toki[i]-t;

printf("%d %d %d\n",kekkat[i],kekkaf[i],kekkab[i]);

}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:4: error: 'kakkaf' undeclared (first use in this function); did you mean 'kekkaf'?
   20 | if(kakkaf[i]<0){
      |    ^~~~~~
      |    kekkaf
main.c:20:4: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(){
int toki[3],tokide[3],fun[3],funde[3],byou[3],byoude[3];
int i,f,t;
int kekkat[3],kekkaf[3],kekkab[3];

for(i=0;i<3;i++){
scanf("%d %d %d %d %d %d",&toki[i],&fun[i],&byou[i],&tokide[i],&funde[i],&byoude[i]);
}
for(i=0;i<3;i++){
f=0;
t=0;
kekkab[i]=byoude[i]-byou[i];
if(kekkab[i]<0){
kekkab[i]=60+kekkab[i];
f++;
}
kekkaf[i]=funde[i]-fun[i]-f;
if(kekkaf[i]<0){
kekkaf[i]=60+kakkaf[i];
t++;
}
kekkat[i]=tokide[i]-toki[i]-t;

printf("%d %d %d\n",kekkat[i],kekkaf[i],kekkab[i]);

}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:21:14: error: 'kakkaf' undeclared (first use in this function); did you mean 'kekkaf'?
   21 | kekkaf[i]=60+kakkaf[i];
      |              ^~~~~~
      |              kekkaf
main.c:21:14: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(void)
{
	int h1,h2,h3,m1,m2,m3,s1,s2,s3;
	for(i=1;i<=3;i++) {
		scanf("%d %d %d %d %d %d",&h1,&m1,&s1,&h2,&m2,&s2);
			s3=s2-s1;
			m3=m2-m1;
			h3=h2-h1;
			if(s3<0) {
				m3--;
				s3+=60;
			}
			if(m3<0) {
				h3--;
				m3+=60;
			}
		printf("%d %d %d\n",h3,m3,s3);
	}
	return 0;
}

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

#include <stdio.h>

int main(){
    int time[3][9]= {{0},{0}}, i, j;
    
    for (i = 0; i < 3; i++) {
        for (j = 0; j < 6; j++) {
            scanf("%d", &time[i][j]);
        }
    }
    
    for (i = 0; i < 3; i++) {
        if ((time[i][8] += time[i][5] - time[i][2]) < 0){
            time[i][8] += 60;
            time[i][7] -= 1;
        }
        if((time[i][7] += time[i][4] - time[i][1]) < 0){
            time[i][7] += 60;
            time[i][6] -= 1;
        }
        time[i][6] += time[i][3] - time[i][0];
    }
    
    for (i = 0; i < 3; i++)
        printf("%d %d %d\n", time[i][6], time[i][7], time[i][8])
    
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:25:65: error: expected ';' before 'return'
   25 |         printf("%d %d %d\n", time[i][6], time[i][7], time[i][8])
      |                                                                 ^
      |                                                                 ;
   26 | 
   27 |     return 0;
      |     ~~~~~~