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

#include<stdio.h>
int main() {
	char a[200][200];
	char b[200][200];
	char c[200][200];
	bool check = false;;
	int H, W,i,j,y,t;
	//入力
	scanf("%d %d", &H, &W);
	for (i = 0; i < H; i++) {
		for (j = 0; j <= W; j++) {
			scanf("%c", &a[i][j]);
		}
	}

	y = 0;
	for (i = 0; i < H; i++) {
		check = false;
		for (j = 0; j <= W; j++) {
			if (a[i][j] == '#') {
				check = true;
			}
		}
		if (check) {
			for (j = 0; j <= W; j++) {
				b[y][j] = a[i][j];
			}
			y++;
		}
	}

	//printf("y=%d", y);
	/*for (i = 0; i < y; i++) {
		for (j = 0; j <= W; j++) {
			printf("%c",b[i][j]);
		}
	}*/


	t = 0;
	for (i = 0; i <= W; i++) {
		check = false;
		for (j = 0; j < y; j++) {
			if (b[j][i] == '#') {
				check = true;
			}
		}
		if (check) {
			for (j = 0; j < y; j++) {
				c[j][t] = b[j][i];
			}
				t++;
		}
	}



	//printf("t=%d", t);
	for (i = 0; i < y; i++) {
		//for (j = 0; j <= t; j++) {
		//printf("%c",c[i][j]);
		//}
		c[i][t] = '\n';
	}

		for (i = 0; i < y; i++) {
			for (j = 0; j <= t; j++) {
				printf("%c", c[i][j]);
			}
		}

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:9: error: unknown type name 'bool'
    6 |         bool check = false;;
      |         ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include<stdio.h>
  +++ |+#include <stdbool.h>
    2 | int main() {
main.c:6:22: error: 'false' undeclared (first use in this function)
    6 |         bool check = false;;
      |                      ^~~~~
main.c:6:22: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:6:22: note: each undeclared identifier is reported only once for each function it appears in
main.c:21:41: error: 'true' undeclared (first use in this function)
   21 |                                 check = true;
      |                                         ^~~~
main.c:21:41: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C

#include<stdio.h>
int main() {
	char a[200][200];
	char b[200][200];
	char c[200][200];
	bool check;
	int H, W,i,j,y,t;
	//入力
	scanf("%d %d", &H, &W);
	for (i = 0; i < H; i++) {
		for (j = 0; j <= W; j++) {
			scanf("%c", &a[i][j]);
		}
	}

	y = 0;
	for (i = 0; i < H; i++) {
		check = false;
		for (j = 0; j <= W; j++) {
			if (a[i][j] == '#') {
				check = true;
			}
		}
		if (check) {
			for (j = 0; j <= W; j++) {
				b[y][j] = a[i][j];
			}
			y++;
		}
	}

	//printf("y=%d", y);
	/*for (i = 0; i < y; i++) {
		for (j = 0; j <= W; j++) {
			printf("%c",b[i][j]);
		}
	}*/


	t = 0;
	for (i = 0; i <= W; i++) {
		check = false;
		for (j = 0; j < y; j++) {
			if (b[j][i] == '#') {
				check = true;
			}
		}
		if (check) {
			for (j = 0; j < y; j++) {
				c[j][t] = b[j][i];
			}
				t++;
		}
	}



	//printf("t=%d", t);
	for (i = 0; i < y; i++) {
		//for (j = 0; j <= t; j++) {
		//printf("%c",c[i][j]);
		//}
		c[i][t] = '\n';
	}

		for (i = 0; i < y; i++) {
			for (j = 0; j <= t; j++) {
				printf("%c", c[i][j]);
			}
		}

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:9: error: unknown type name 'bool'
    6 |         bool check;
      |         ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include<stdio.h>
  +++ |+#include <stdbool.h>
    2 | int main() {
main.c:18:25: error: 'false' undeclared (first use in this function)
   18 |                 check = false;
      |                         ^~~~~
main.c:18:25: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:18:25: note: each undeclared identifier is reported only once for each function it appears in
main.c:21:41: error: 'true' undeclared (first use in this function)
   21 |                                 check = true;
      |                                         ^~~~
main.c:21:41: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: Java

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.List;
import java.util.Scanner;
import java.util.ArrayList;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Kenji
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Main solver = new Main();
        solver.solve(1, in, out);
        out.close();
    }

    static class Main {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int H = in.nextInt();
            int W = in.nextInt();
            List<String> list = new ArrayList<>();
            for (int i = 0; i < H; i++) {
                list.add(in.next());
            }
            for (int i = 0; i < H; i++) {
                String s = list.get(i);
                if (s.indexOf("#") == -1) {
                    s = s.replaceAll(".", "!");
                    list.set(i, s);
                }
            }
            for (int i = 0; i < W; i++) {
                boolean f = true;
                for (int j = 0; j < H; j++) {
                    String s = list.get(j);
                    if (s.charAt(i) == '#') {
                        f = false;
                    }
                }
                if (f) {
                    for (int j = 0; j < H; j++) {
                        String s = list.get(j);
                        String s2 = s.substring(0, i) + "!" + s.substring(i + 1, s.length());
                        list.set(j, s2);
                    }
                }
            }
            for (int i = 0; i < H; i++) {
                String s = list.get(i);
                boolean f = false;
                for (int j = 0; j < s.length(); j++) {
                    if (s.charAt(j) != '!') {
                        out.append(s.charAt(j));
                        f = true;
                    }
                }
                if (f) {
                    out.println();
                }
            }
        }

    }
}



Compiler output:
Main.java:26: error: class Main is already defined in package unnamed package
    static class Main {
           ^
1 error
Language: C

#include<stdio.h>
int main()
{
	int h,w,i,j;
	scanf("%d %d\n",&h,&w);
	int a[h+1][w+1],hi[h+1],wj[w+1];
	for(i=1;i<=h;i++)hi[i]=0;
	for(j=1;j<=w;j++)wj[j]=0;
	for(i=1;i<=h;i++){
		for(j=1;j<=w;j++){
			scanf("%c",&a[i][j]);
			if(a[i][j]='#'){
				hi[i]=1;
				wj[j]=1;
			}
		}
		printf("\n");
	}
	for(i=1;i<=h;i++){
		if(hi[i]=1){
			for(ij=1;j<=w;j++){
				if(wj[j]=1){
					printf("%c",a[i][j]);
				}
			}
			printf("\n");
		}
	}
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:21:29: error: 'ij' undeclared (first use in this function); did you mean 'wj'?
   21 |                         for(ij=1;j<=w;j++){
      |                             ^~
      |                             wj
main.c:21:29: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
#include <cstring>
#include <casdh>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
#include <sstream>
#include <stack>
#include <deque>
using namespace std;
#define ll long long
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define pi pair<int,int>
#define pii pair<pi,int>
#define sqr(x) ((x)*(x))
#define FOR for(int i=0;i<n;i++)for(int j=0;j<m;j++)
const int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
int n,m;
string asd[105];
bool f[105],c[105];
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);cout.tie(0); 
    cin>>n>>m;
    for(int i=0;i<n;i++)cin>>asd[i];
    for(int i=0;i<n;i++){
        bool flag=true;
        for(int j=0;j<m;j++)if(asd[i][j]=='#'){flag=false;break;}
        f[i]=flag;}
    for(int j=0;j<m;j++){
        bool flag=true;
        for(int i=0;i<n;i++)if(asd[i][j]=='#'){flag=false;break;}
        c[j]=flag;}
    for(int i=0;i<n;i++){
        if(f[i])continue;
        for(int j=0;j<m;j++)if(!c[j])cout<<asd[i][j];
        cout<<'\n';}
    return 0;
}


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

#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <cmath>

using namespace std;
const int MAX_H = 100;
int H, W;
char as[MAX_H][MAX_H];
bool remove_w[MAX_H];
bool remove_h[MAX_H];

void solve() {
    for (int h = 0; h < H; ++h) {
        int count = 0;
        for (int w = 0; w < W; ++w) if (as[h][w] == '.') count++;
        if (count == W) remove_w[h] = true;
    }
    for (int w = 0; w < W; ++w) {
        int count = 0;
        for (int h = 0; h < H; ++h) if (as[h][w] == '.') count++;
        if (count == H) remove_h[w] = true;
    }

    for (int h = 0; h < H; ++h) {
        if (remove_w[h]) continue;
        for (int w = 0; w < W; ++w) {
            if (remove_h[w]) continue;
            printf("%c", as[h][w]);
        }
        printf("\n");
    }
}

int main() {
    cin >> H >> W;
    for (int h = 0; h < H; ++h) {
        for (int w = 0; w < W; ++w) {
            cin >> as[h][w];
        }
    }
    solve();
    return 0;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include <cstdio>
^
Main.java:2: error: illegal character: '#'
#include <algorithm>
^
Main.java:3: error: illegal character: '#'
#include <iostream>
^
Main.java:4: error: illegal character: '#'
#include <vector>
^
Main.java:5: error: illegal character: '#'
#include <map>
^
Main.java:6: error: illegal character: '#'
#include <unordered_map>
^
Main.java:7: error: illegal character: '#'
#include <cmath>
^
Main.java:10: error: class, interface, enum, or record expected
const int MAX_H = 100;
^
Main.java:11: error: class, interface, enum, or record expected
int H, W;
^
Main.java:12: error: class, interface, enum, or record expected
char as[MAX_H][MAX_H];
^
Main.java:13: error: class, interface, enum, or record expected
bool remove_w[MAX_H];
^
Main.java:14: error: class, interface, enum, or record expected
bool remove_h[MAX_H];
^
Main.java:16: error: unnamed classes are a preview feature and are disabled by default.
void solve() {
^
  (use --enable-preview to enable unnamed classes)
Main.java:39: error: not a statement
    cin >> H >> W;
             ^
Main.java:42: error: not a statement
            cin >> as[h][w];
                ^
15 errors
Language: C++

/*
解き方：
対角成分が黒であれば、その行と列は削られない。
逆に言えば、対角成分が白の場所しか削られない。

*/

#include <iostream>
#include <cstdio>

using namespace std;

int main(){
  int h, w;
  cin >> h >> w;
  char map[101][101] = {};
  int chk[101][101] = {};

  for(int i = 0; i < h; i++){
    scanf("%s", map[i]);
  }

  for(int i=0;i<h;i++) { //横を見る
      bool flag=false;
      //その列に黒があればフラグを立てる
      for(int j=0;j<w;j++) if(map[i][j]=='#') flag=true;
      if(!flag) for(int j=0;j<w;j++) chk[i][j]=true;
  }

  for(int i=0; i < w; i++){ //縦を見る
    bool flag =  false;
    for(int j = 0; j < h; j++) if(map[j][i] == '#') flag = true;
    if(!flag) for(int j = 0; j<h; j++) chk[j][i] =true;
  }

  for(int i=0; i < h; i++){
    bool flag = false;
    for(int j=0; j < w; j++){
      if(!chk[i][j]){ // フラグが立ってないとこをみて
        flag = true;
        printf("%c", s[i][j]);
      }
    }
    if(flag) puts("");
  }


}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:22: error: 's' was not declared in this scope
   41 |         printf("%c", s[i][j]);
      |                      ^
Language: C++

#include <iostream>
using namespace std;

void show(int x,int y,char data[x][y]){
  for(int i = 0;i < y;i++){
    for(int j = 0;j < x;j++){
      cout << data[i][j];
    }
    cout << endl;
  }
}


int main(){
  int h,w;
  cin >> h >> w;
  char grid[w][h];

  for(int y = 0;y < h;y++){
    cin >> grid[y];
  }

  for(int y = 0;y < h;y++){
    bool f = false;
    for(int x = 0;x < w;x++){
      if(grid[y][x] == '#'){
  	f = true;
      }
    }
    if(f == false){
      for(int x = 0;x < w;x++){
  	grid[y][x] = '*';
      }
    }
  }
  /*
  cout << endl;
 for(int y = 0;y < h;y++){
    for(int x = 0;x < w;x++){
     
	cout << grid[y][x];
    }
      cout << endl;
  }
  */

  for(int x = 0;x < w;x++){
    bool f = false;
    for(int y = 0;y < h;y++){
      if(grid[y][x] == '#'){
	f = true;
      }
    }
    if(f == false){
      for(int y = 0;y < h;y++){
	grid[y][x] = '*';
      }
    }
  }

  for(int y = 0;y < h;y++){
    for(int x = 0;x < w;x++){
      if(grid[y][x] != '*')
	cout << grid[y][x];
    }
    bool f = false;
    for(int x = 0;x < w;x++){
      if(grid[y][x] != '*')
	f = true;
    }
    if(f == true)cout << endl;
  }

  return 0;
}
  
  
  
  
  
  
  
  
  
  
  
  
  
  


Compiler output:
a.cc:4:34: error: use of parameter outside function body before ']' token
    4 | void show(int x,int y,char data[x][y]){
      |                                  ^
a.cc:4:37: error: use of parameter outside function body before ']' token
    4 | void show(int x,int y,char data[x][y]){
      |                                     ^
a.cc: In function 'void show(...)':
a.cc:5:21: error: 'y' was not declared in this scope
    5 |   for(int i = 0;i < y;i++){
      |                     ^
a.cc:6:23: error: 'x' was not declared in this scope
    6 |     for(int j = 0;j < x;j++){
      |                       ^
a.cc:7:19: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
    7 |       cout << data[i][j];
      |                   ^
Language: C++

#include <iostream>
using namespace std;

void show(int x,int y,char data[x][y]){
  for(int i = 0;i < y;i++){
    for(int j = 0;j < x;j++){
      cout << data[i][j];
    }
    cout << endl;
  }
}


int main(){
  int h,w;
  cin >> h >> w;
  char grid[w][h];

  for(int y = 0;y < h;y++){
    cin >> grid[y];
  }

  for(int y = 0;y < h;y++){
    bool f = false;
    for(int x = 0;x < w;x++){
      if(grid[y][x] == '#'){
  	f = true;
      }
    }
    if(f == false){
      for(int x = 0;x < w;x++){
  	grid[y][x] = '*';
      }
    }
  }
  cout << endl;
 for(int y = 0;y < h;y++){
    for(int x = 0;x < w;x++){
     
	cout << grid[y][x];
    }
      cout << endl;
  }

  for(int x = 0;x < w;x++){
    bool f = false;
    for(int y = 0;y < h;y++){
      if(grid[y][x] == '#'){
	f = true;
      }
    }
    if(f == false){
      for(int y = 0;y < h;y++){
	grid[y][x] = '*';
      }
    }
  }
  cout << endl << endl;
  for(int y = 0;y < h;y++){
    for(int x = 0;x < w;x++){
      if(grid[y][x] != '*')
	cout << grid[y][x];
    }
    bool f = false;
    for(int x = 0;x < w;x++){
      if(grid[y][x] != '*')
	f = true;
    }
    if(f == true)cout << endl;
  }

  return 0;
}
  
  
  
  
  
  
  
  
  
  
  
  
  
  


Compiler output:
a.cc:4:34: error: use of parameter outside function body before ']' token
    4 | void show(int x,int y,char data[x][y]){
      |                                  ^
a.cc:4:37: error: use of parameter outside function body before ']' token
    4 | void show(int x,int y,char data[x][y]){
      |                                     ^
a.cc: In function 'void show(...)':
a.cc:5:21: error: 'y' was not declared in this scope
    5 |   for(int i = 0;i < y;i++){
      |                     ^
a.cc:6:23: error: 'x' was not declared in this scope
    6 |     for(int j = 0;j < x;j++){
      |                       ^
a.cc:7:19: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
    7 |       cout << data[i][j];
      |                   ^
Language: C++

#include <iostream>
#include <algorithm>
#include <math.h>
#include <string.h>

typedef long long ll;
using namespace std;

int main()
{
    int h, w;
    char a[100][100];
    int b[100]={0}, c[100]={0};
    
    cin >> h >> w;

    for(int i = 0; i<h; i++){
        cnt = 0;
        for(int j=0; j<w; j++){
            cin >> a[i][j];
        }
    }

    for(int i = 0; i<w; i++){
        for(int j=0; j<h; j++){
            if(a[i][j] == '#') {
                b[i] = 1;
                c[j] = 1;
            }
        }
    }

    for(int i=0; i<h; i++){
        if(b[i]>0){
            for(int j=0; j<w; j++){
                if(c[j]>0)cout << a[i][j];
            }
            cout << endl;
        }
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'cnt' was not declared in this scope; did you mean 'int'?
   18 |         cnt = 0;
      |         ^~~
      |         int
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
    int h,w;
    cin >> h >> w;
    string g[h];
    for (int i=0; i<h; i++){
        cin >> g[i];
    }
    int a[h];
    int b[w];
    string h_blank="";
    string w_blank="";
    for (int i=0; i<h; i++){
        h_blank+='.';
        a[i]=0;
    }
    for (int i=0; i<w; i++){
        w_blank+='.';
        b[i]=0;
    }

    for (int i=0; i<h; i++){
        if (g[i]==h_blank){
            a[i]=1;
        }
    }
    for (int j=0; j<w; j++){
        string t="";
        for (int i=0; i<h; i++){
            t+=g[i][j];
        }
        if (t==w_blank){
            b[i]=1;
        }
    }

    for (int i=0; i<h; i++){
        for (int j=0; j<w; j++){
            if (a[i]==0 && b[j]==0){
                cout << g[i][j];
            }
        }
        cout <<endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:15: error: 'i' was not declared in this scope
   35 |             b[i]=1;
      |               ^
Language: C

#include<stdio.h>
int main(){
int a,b,i,j;
int f=0;
int g=0;
int h=0;
char c[100][100];
char d[100][100];
scanf("%d %d", &a,&b);

for(i=0; i<a; i++){
scanf("%c %c %c %c %c", c[i][1], c[i][2], c[i][3], c[i][4], c[i][5]);

for(j=0;j<b;j++){
for(i=0,i<a;i++){
if(c[i][j] == '.') f++;
}
if(f == a){
g++;
if(i != a){
d[i][j] = c[i+1][j];
}else{
d[i][j] = c[i][j];}
}else{
d[i][j] = c[i][j];
}
f=0;
}

for(i=0,i<a;i++){
for(j=0;j<b;j++){
if(c[i][j] == '.') f++;
}
if(f == b){
h++;
if(i != b){
d[i][j] = c[i][j+1];
}else{
d[i][j] = c[i][j];}
}else{
d[i][j] = c[i][j];
}
f=0;
}

for(i=0;i<a-g;i++){
for(j=0;j<b-h;j++){
printf("%c ", d[i][j]);
}
printf("\n");
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:16: error: expected ';' before ')' token
   15 | for(i=0,i<a;i++){
      |                ^
      |                ;
main.c:30:16: error: expected ';' before ')' token
   30 | for(i=0,i<a;i++){
      |                ^
      |                ;
main.c:53:1: error: expected declaration or statement at end of input
   53 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

int main(void){
	char matrix[100][100];
	int matrixX[100];
	int matrixY[100];
	cin >> H >> W;
	int X=0;
	int Y=0;
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			cin >> matrix[i][j];
		}
	}

	for(int i=0;i<H;i++){
		bool judge=true;
		for(int j=0;j<W;j++){
			if(matrix[i][j] == '#'){
				judge=false;
				break;
			}
		}
		if(judge){
			matrixX[X]=i;
			X++;
		}
	}

	for(int j=0;j<W;j++){
		bool judge = true;
		for(int i=0;i<H;i++){
			if(matrix[i][j] == '#'){
				judge=false;
				break;
			}
		}
		if(judge){
			matrixY[Y] = j;
			Y++;
		}
	}
	int XX=0,YY=0;
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			if(matrixX[XX]==i){
				XX++;
				break;
			}else if(matrixY[YY]==j){
				YY++;
				break;
			}else{
				cout << matrix[i][j];
			}
		}
		cout << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: 'H' was not declared in this scope
    8 |         cin >> H >> W;
      |                ^
a.cc:8:21: error: 'W' was not declared in this scope
    8 |         cin >> H >> W;
      |                     ^
Language: C++

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

int main() {
  int H, W;
  string a;
  cin >> H,H;

  

  // 数学の点数データを受け取る
  for (int i = 0; i < H; i++) {
    
    for (int j = 0; j < W; j++){
      cin >> a;
    }
   
  }
  
  if(a!="."){
    cout << a << endl;
  }
    

 


Compiler output:
a.cc: In function 'int main()':
a.cc:22:4: error: expected '}' at end of input
   22 |   }
      |    ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

int main() {
  int H, W;
  string a;
  cin >> H,H;

  vector<int> math(N); // N個の数学の点数データ
  vector<int> english(N); // N個の英語の点数データ

  // 数学の点数データを受け取る
  for (int i = 0; i < H; i++) {
    
    for (int j = 0; j < W; j++){
      cin >> a;
    }
   
  }
  
  if(a!="."){
    cout << a << endl;
  }
    

 


Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: 'N' was not declared in this scope
    9 |   vector<int> math(N); // N個の数学の点数データ
      |                    ^
a.cc:23:4: error: expected '}' at end of input
   23 |   }
      |    ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

int main() {
  int H, W;
  string a;
  cin >> N,H;

  vector<int> math(N); // N個の数学の点数データ
  vector<int> english(N); // N個の英語の点数データ

  // 数学の点数データを受け取る
  for (int i = 0; i < H; i++) {
    
    for (int j = 0; j < W; j++){
      cin >> a;
    }
   
  }
  
  if(a!="."){
    cout << a << endl;
  }
    

 


Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: 'N' was not declared in this scope
    7 |   cin >> N,H;
      |          ^
a.cc:23:4: error: expected '}' at end of input
   23 |   }
      |    ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C

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


int main(void)
{
	int H,W;
	scanf("%d",&H);
	scanf("%d",&W);
	char a[H*W];
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			scanf("%s",&a[i*W+j]);
		}
	}
	for(int i=0;i<H;i++){
		int m=0;
		for(int j=0;j<W;j++){
			if(a[i*W+j]=='-') == 0){
				m++;
			}
		}
		if(m==W){
			for(int l=i;l<H;l++){
				for(int j=0;j<W;j++){
					a[l*W+j]=a[(l+1)*W+j];
				}
			}
		}
		

	}

	for(int i=0;i<W;i++){
		int n=0;
		for(int j=0;j<H;j++){
			if(a[i*W+j]=='-') == 0){
				n++;
			}
		}
		if(n==H){
			for(int l=i;l<W;l++){
				for(int j=0;j<H;j++){
					a[l*W+j]=a[l*W+j+1];
				}
			}
		}
	}
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			printf("%s",a[i*W+j]);
		}
		printf("\n");
	}
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:43: error: expected expression before '==' token
   19 |                         if(a[i*W+j]=='-') == 0){
      |                                           ^~
main.c:19:47: error: expected statement before ')' token
   19 |                         if(a[i*W+j]=='-') == 0){
      |                                               ^
main.c:37:43: error: expected expression before '==' token
   37 |                         if(a[i*W+j]=='-') == 0){
      |                                           ^~
main.c:37:47: error: expected statement before ')' token
   37 |                         if(a[i*W+j]=='-') == 0){
      |                                               ^
Language: C

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


int main(void)
{
	int H,W;
	scanf("%d",&H);
	scanf("%d",&W);
	char a[H*W];
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			scanf("%s",&a[i*W+j]);
		}
	}
	for(int i=0;i<H;i++){
		int m=0;
		for(int j=0;j<W;j++){
			if(a[i*W+j]='=') == 0){
				m++;
			}
		}
		if(m==W){
			for(int l=i;l<H;l++){
				for(int j=0;j<W;j++){
					a[l*W+j]=a[(l+1)*W+j];
				}
			}
		}
		

	}

	for(int i=0;i<W;i++){
		int n=0;
		for(int j=0;j<H;j++){
			if(a[i*W+j]='-') == 0){
				n++;
			}
		}
		if(n==H){
			for(int l=i;l<W;l++){
				for(int j=0;j<H;j++){
					a[l*W+j]=a[l*W+j+1];
				}
			}
		}
	}
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			printf("%s",a[i*W+j]);
		}
		printf("\n");
	}
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:42: error: expected expression before '==' token
   19 |                         if(a[i*W+j]='=') == 0){
      |                                          ^~
main.c:19:46: error: expected statement before ')' token
   19 |                         if(a[i*W+j]='=') == 0){
      |                                              ^
main.c:37:42: error: expected expression before '==' token
   37 |                         if(a[i*W+j]='-') == 0){
      |                                          ^~
main.c:37:46: error: expected statement before ')' token
   37 |                         if(a[i*W+j]='-') == 0){
      |                                              ^
Language: Java

import java.util.*;

public class Test {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int h = s.nextInt();
        int w = s.nextInt();
        s.nextLine();
        List<String> list = new LinkedList<>();
        int a = h;
        for (int i = 0; i < h; i++) {
             String ss = s.nextLine();
             if(ss.contains("#")) {
                 list.add(ss);
             } else {
                 a--;
             }
        }



        for(int i=0;i<w;i++) {
            int j = 0;
            for(;j<a;j++) {
                if(list.get(j).charAt(i)=='#') {
                    break;
                }
            }
            if(j==a) {
                for(int k=0;k<a;k++) {
                    StringBuilder sb = new StringBuilder(list.get(k));
                    sb.deleteCharAt(i);
                    list.remove(k);
                    list.add(k,new String(sb));
                }
                w--;
            }
        }
        for(int i=0;i<a;i++) {
            System.out.println(list.get(i));
        }
    }
}

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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int H,W;
  cin >> H >> W;
  vector<vector<char>> a(H*W);
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){cin >> a[i][j];}
  }
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      if(a[i
   


Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: expected ']' at end of input
   13 |       if(a[i
      |             ^
      |             ]
a.cc:13:13: error: expected ')' at end of input
   13 |       if(a[i
      |         ~   ^
      |             )
a.cc:13:13: error: could not convert 'a.std::vector<std::vector<char> >::operator[](((std::vector<std::vector<char> >::size_type)i))' from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<char> >, std::vector<char> >::value_type' {aka 'std::vector<char>'} to 'bool'
   13 |       if(a[i
      |             ^
      |             |
      |             __gnu_cxx::__alloc_traits<std::allocator<std::vector<char> >, std::vector<char> >::value_type {aka std::vector<char>}
a.cc:13:13: error: expected statement at end of input
a.cc:13:13: error: expected '}' at end of input
a.cc:12:25: note: to match this '{'
   12 |     for(int j=0;j<W;j++){
      |                         ^
a.cc:13:13: error: expected '}' at end of input
   13 |       if(a[i
      |             ^
a.cc:11:23: note: to match this '{'
   11 |   for(int i=0;i<H;i++){
      |                       ^
a.cc:13:13: error: expected '}' at end of input
   13 |       if(a[i
      |             ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include<iostream>
#include<cstring>
#include<string>
#include<algorithm>
#include<cstdio>
#include<cmath>
using namespace std;
char a[104][104];
vector<int> del_hang;
vector<int> del_lie;
int main()
{
    int H,W;
    int i,j,k;
    int h,w;
    int flag;
    while(cin>>H>>W)
   {   
       memset(a,0,sizeof(a));
       del_hang.clear();
       del_lie.clear();
       for(i=0;i<H;i++)
          for(j=0;j<W;j++)
            cin>>a[i][j];
       for(j=0;j<H;j++)
       {
	 for(i=0;i<W;i++)
         {
          if(a[j][i]!='.') break;
         }
          if(i>=W) del_hang.push_back(j+1);
       }

       for(i=0;i<W;i++)
       {
	       for(j=0;j<H;j++)
         {
          if(a[j][i]!='.') break;
         }
          if(j>=H) del_lie.push_back(i+1);
       }
       
       for(i=0;i<W;i++) //列
       {
       	 vector<int>::iterator result = find( del_lie.begin( ), del_lie.end( ), i+1 ); 
         if(result==del_lie.end()) continue;
				  for(j=0;j<H;j++)//行
         {
           a[j][i]='@';
          }
       }

       for(i=0;i<H;i++) 
       {
          flag=0;
          for(j=0;j<W;j++)
         {
           if(del_hang.size())
           {
            if(i==del_hang[0]-1){del_hang.erase(del_hang.begin());break;}
            }
           if(a[i][j]!='@') 
            {cout<<a[i][j];flag=1;}
          }
          if(flag) cout<<endl;
       }
    }   

}

Compiler output:
a.cc:9:1: error: 'vector' does not name a type
    9 | vector<int> del_hang;
      | ^~~~~~
a.cc:10:1: error: 'vector' does not name a type
   10 | vector<int> del_lie;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:20:8: error: 'del_hang' was not declared in this scope
   20 |        del_hang.clear();
      |        ^~~~~~~~
a.cc:21:8: error: 'del_lie' was not declared in this scope
   21 |        del_lie.clear();
      |        ^~~~~~~
a.cc:45:10: error: 'vector' was not declared in this scope
   45 |          vector<int>::iterator result = find( del_lie.begin( ), del_lie.end( ), i+1 );
      |          ^~~~~~
a.cc:7:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    6 | #include<cmath>
  +++ |+#include <vector>
    7 | using namespace std;
a.cc:45:17: error: expected primary-expression before 'int'
   45 |          vector<int>::iterator result = find( del_lie.begin( ), del_lie.end( ), i+1 );
      |                 ^~~
a.cc:46:13: error: 'result' was not declared in this scope
   46 |          if(result==del_lie.end()) continue;
      |             ^~~~~~
Language: C

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


int main(void)
{
	int H,W;
	scanf("%d",&H);
	scanf("%d",&W);
	char a[H*W];
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			scanf("%s",&a[i*W+j]);
		}
	}
	for(int i=0;i<H;i++){
		int a=0;
		for(int j=0;j<W;j++){
			if(strcmp(a[i*W+j],"-") == 0){
				a++;
			}
		}
		if(a==W){
			for(int l=i;l<H;l++){
				for(int j=0;j<W;j++){
					a[l*W+j]=a[(l+1)*W+j];
				}
			}
		}
		

	}

	for(int i=0;i<W;i++){
		int a=0;
		for(int j=0;j<H;j++){
			if(strcmp(a[i*W+j],"-") == 0){
				a++;
			}
		}
		if(a==H){
			for(int l=i;l<W;l++){
				for(int j=0;j<H;j++){
					a[l*W+j]=a[l*W+j+1];
				}
			}
		}
	}
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			printf("%s",a[i*W+j]);
		}
		printf("\n");
	}
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:36: error: subscripted value is neither array nor pointer nor vector
   19 |                         if(strcmp(a[i*W+j],"-") == 0){
      |                                    ^
main.c:26:42: error: subscripted value is neither array nor pointer nor vector
   26 |                                         a[l*W+j]=a[(l+1)*W+j];
      |                                          ^
main.c:26:51: error: subscripted value is neither array nor pointer nor vector
   26 |                                         a[l*W+j]=a[(l+1)*W+j];
      |                                                   ^
main.c:37:36: error: subscripted value is neither array nor pointer nor vector
   37 |                         if(strcmp(a[i*W+j],"-") == 0){
      |                                    ^
main.c:44:42: error: subscripted value is neither array nor pointer nor vector
   44 |                                         a[l*W+j]=a[l*W+j+1];
      |                                          ^
main.c:44:51: error: subscripted value is neither array nor pointer nor vector
   44 |                                         a[l*W+j]=a[l*W+j+1];
      |                                                   ^
Language: C

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


int main(void)
{
	int H,W;
	scanf("%d",&H);
	scanf("%d",&W);
	char a[H*W];
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			scanf("%s",&a[i*W+j]);
		}
	}
	for(int i=0;i<H;i++){
		int a=0;
		for(int j=0;j<W;j++){
			if(strcmp(a[i*W+j],'-') == 0){
				a++;
			}
		}
		if(a==W){
			for(int l=i;l<H;l++){
				for(int j=0;j<W;j++){
					a[l*W+j]=a[(l+1)*W+j];
				}
			}
		}
		

	}

	for(int i=0;i<W;i++){
		int a=0;
		for(int j=0;j<H;j++){
			if(strcmp(a[i*W+j],'-') == 0){
				a++;
			}
		}
		if(a==H){
			for(int l=i;l<W;l++){
				for(int j=0;j<H;j++){
					a[l*W+j]=a[l*W+j+1];
				}
			}
		}
	}
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			printf("%s",a[i*W+j]);
		}
		printf("\n");
	}
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:36: error: subscripted value is neither array nor pointer nor vector
   19 |                         if(strcmp(a[i*W+j],'-') == 0){
      |                                    ^
main.c:19:44: error: passing argument 2 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
   19 |                         if(strcmp(a[i*W+j],'-') == 0){
      |                                            ^~~
      |                                            |
      |                                            int
In file included from main.c:2:
/usr/include/string.h:156:50: note: expected 'const char *' but argument is of type 'int'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                                      ~~~~~~~~~~~~^~~~
main.c:26:42: error: subscripted value is neither array nor pointer nor vector
   26 |                                         a[l*W+j]=a[(l+1)*W+j];
      |                                          ^
main.c:26:51: error: subscripted value is neither array nor pointer nor vector
   26 |                                         a[l*W+j]=a[(l+1)*W+j];
      |                                                   ^
main.c:37:36: error: subscripted value is neither array nor pointer nor vector
   37 |                         if(strcmp(a[i*W+j],'-') == 0){
      |                                    ^
main.c:37:44: error: passing argument 2 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
   37 |                         if(strcmp(a[i*W+j],'-') == 0){
      |                                            ^~~
      |                                            |
      |                                            int
/usr/include/string.h:156:50: note: expected 'const char *' but argument is of type 'int'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                                      ~~~~~~~~~~~~^~~~
main.c:44:42: error: subscripted value is neither array nor pointer nor vector
   44 |                                         a[l*W+j]=a[l*W+j+1];
      |                                          ^
main.c:44:51: error: subscripted value is neither array nor pointer nor vector
   44 |                                         a[l*W+j]=a[l*W+j+1];
      |                                                   ^
Language: C

#include <stdio.h>


int main(void)
{
	int H,W;
	scanf("%d",&H);
	scanf("%d",&W);
	char a[H*W];
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			scanf("%s",&a[i*W+j]);
		}
		printf("\n");
	}
	for(int i=0;i<H;i++){
		int a=0;
		for(int j=0;j<W;j++){
			if(a[i*W+j]=='-'){
				a++;
			}
		}
		if(a==W){
			for(int l=i;l<H;l++){
				for(int j=0;j<W;j++){
					a[l*W+j]=a[(l+1)*W+j];
				}
			}
		}
		

	}

	for(int i=0;i<W;i++){
		int a=0;
		for(int j=0;j<H;j++){
			if(a[i*W+j]=='-'){
				a++;
			}
		}
		if(a==H){
			for(int l=i;l<W;l++){
				for(int j=0;j<H;j++){
					a[l*W+j]=a[l*W+j+1];
				}
			}
		}
	}
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			printf("%s",a[i*W+j]);
		}
		printf("\n");
	}
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:29: error: subscripted value is neither array nor pointer nor vector
   19 |                         if(a[i*W+j]=='-'){
      |                             ^
main.c:26:42: error: subscripted value is neither array nor pointer nor vector
   26 |                                         a[l*W+j]=a[(l+1)*W+j];
      |                                          ^
main.c:26:51: error: subscripted value is neither array nor pointer nor vector
   26 |                                         a[l*W+j]=a[(l+1)*W+j];
      |                                                   ^
main.c:37:29: error: subscripted value is neither array nor pointer nor vector
   37 |                         if(a[i*W+j]=='-'){
      |                             ^
main.c:44:42: error: subscripted value is neither array nor pointer nor vector
   44 |                                         a[l*W+j]=a[l*W+j+1];
      |                                          ^
main.c:44:51: error: subscripted value is neither array nor pointer nor vector
   44 |                                         a[l*W+j]=a[l*W+j+1];
      |                                                   ^
Language: C++

#include<iostream>

using namespace std;
int main(){
  int a,b,c=0;
  cin >> a >> b;
  char str[100][100];
  int d[100];
  for(int i=0;i!=a;i++){
    for(int j=0;j!=b;j++){
      cin >> str[i][j];
      if(str[i][j]=='.'){
        c++;
        if(c==j){
          c=0;
          for(int o=j;o!=b-1;o++){
            for(int r=0;r!=a;r++){
              str[o][r]=str[o+1][r];
            }
          }
          
        }
      }
      c=0;
    }
  }
  for(j=0;j!=a;j++){
    for(int i=0;i!=b;i++){
      if(str[i][j]=='.'){
        c++;
        if(c==i){
          c=0;
          for(int o=i;o!=b-1;o++){
            for(int r=0;r!=a;r++){
              str[o][r]=str[o][r+1];
            }
          }
          
        }
      }
      c=0;
    }
  }
  for(j=0;j!=a;j++){
    for(int i=0;i!=b;i++){
      cout << str[i][j];
    }
    cout << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:7: error: 'j' was not declared in this scope
   27 |   for(j=0;j!=a;j++){
      |       ^
a.cc:44:7: error: 'j' was not declared in this scope
   44 |   for(j=0;j!=a;j++){
      |       ^
Language: C

#include <stdio.h>
int main(void){
    
    int H,W;
    scan("%d %d"&H,&W);
    
    int i,j;
    int a[H+1][W+1];
    for(i=0;i<H;i++){
        for(j=0;j<W;j++){
            scan("%d",&a[i][j]);
        }
    }
    
    int b[H+1],c[W+1];
    for(i=0;i<H;i++){
        for(j=0;j<W-1;j++){
            if(a[i][j]  != a[i][j+1]){
                break;
            }
            else if(j == W){
                b[i]=1;
            }
        }    
    }
    
    for(j=0;j<W-1;j++){
        for(i=0;i<H;i++){
            if(a[i][j]  != a[i][j+1]){
                break;
            }
            else if(j == W){
                c[i]=1;
            }
        }
    }
    
     for(i=0;i<H;i++){
        for(j=0;j<W;j++){
            if( b[i]!=1) && (c[i]!=1) )
                printf("%d",a[i][j]);
        }
     }
    
    
    
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:5:5: error: implicit declaration of function 'scan'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    5 |     scan("%d %d"&H,&W);
      |     ^~~~
      |     scanf
main.c:5:17: error: invalid operands to binary & (have 'char *' and 'int')
    5 |     scan("%d %d"&H,&W);
      |          ~~~~~~~^
      |          |
      |          char *
main.c:40:29: error: expected identifier before '(' token
   40 |             if( b[i]!=1) && (c[i]!=1) )
      |                             ^
main.c:40:39: error: expected statement before ')' token
   40 |             if( b[i]!=1) && (c[i]!=1) )
      |                                       ^
Language: C++

#include<iostream>

using namespace std;
int main(){
  int a,b,c=0;
  cin >> a >> b;
  char str[100][100];
  int d[100];
  for(int i=0;i!=a;i++){
    for(int j=0;j!=b;j++){
      cin >> str[i][j];
      if(str[i][j]=='.'){
        c++;
        if(c==j){
          c=0;
          for(int o=j;o!=b-1;o++){
            for(int r=0;r!=a;r++){
              str[o][r]=str[o+1][r];
            }
          }
          
        }
      }
      c=0;
    }
  }
  c=0;
  j=0;
  i=0;
  for(j=0;j!=a;j++){
    for(int i=0;i!=b;i++){
      if(str[i][j]=='.'){
        c++;
        if(c==i){
          c=0;
          for(int o=i;o!=b-1;o++){
            for(int r=0;r!=a;r++){
              str[o][r]=str[o][r+1];
            }
          }
          
        }
      }
      c=0;
    }
  }
  c=0;
  j=0;
  i=0;
  for(j=0;j!=a;j++){
    for(int i=0;i!=b;i++){
      cout << str[i][j];
  }
  cout << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:3: error: 'j' was not declared in this scope
   28 |   j=0;
      |   ^
a.cc:29:3: error: 'i' was not declared in this scope
   29 |   i=0;
      |   ^
a.cc:55:2: error: expected '}' at end of input
   55 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <cctype>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <stdio.h>
#include <string.h>
#include <cstdlib>
#include <math.h>
#include <bitset>
#include <iterator>
#include <iomanip>
#include <sstream>
#define INF 2000000000
using namespace std;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
#define sym cout<<"-----------"<<endl;
#define ll long long
#define P pair<int,int>
#define mk make_pair
#define en endl
#define RE return 0
#define int ll



// C

//vector<int> plu;
vector<int> minu;

signed main(){
  int n,k;
  cin>>n>>k;
  for(int i=1; i<=n; i++){
    int x; cin>>x;
    if(x>=0) plu.push_back(x);
    else minu.push_back(abs(x));
  }
  reverse(minu.begin(), minu.end());
  if(plu.size()==0){
    cout<<minu[k-1]<<en; RE;
  }else if(minu.size()==0){
    cout<<plu[k-1]<<en; RE;
  }

  int ans=INF;
  int p=min((int)plu.size(),k)-1;
  cout<<"  p  "<<p<<en;
  for(int i=p-1; i>=0; i--){
    int m=k-i-2;
    cout<<"   m  "<<m<<en;
    if(m>minu.size()-1) continue;
    if(m>=0){
      ans=min(ans,minu[m]+2*plu[i]);
      cout<<"       "<<ans<<en;
    }
  }

  int m=min((int)minu.size(),k);
  for(int i=m-1; i>=0; i--){
    int p=k-i-1;
    if(p>plu.size()-1) continue;
    if(p-1>=0){
      ans=min(ans,plu[p-1]+2*minu[i]);
      cout<<"     "<<ans<<en;
    }
  }

  if(plu.size()>=k) ans=min(ans,plu[k-1]);
  if(minu.size()>=k) ans=min(ans,minu[k-1]);

  cout<<ans<<en;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:45:14: error: 'plu' was not declared in this scope
   45 |     if(x>=0) plu.push_back(x);
      |              ^~~
a.cc:49:6: error: 'plu' was not declared in this scope
   49 |   if(plu.size()==0){
      |      ^~~
a.cc:56:18: error: 'plu' was not declared in this scope
   56 |   int p=min((int)plu.size(),k)-1;
      |                  ^~~
Language: C

#include <stdio.h>


int main(void)
{
	int H,W;
	scanf("%d",&H);
	scanf("%d",&W);
	char a[H][W];
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			scanf("%s",&a[i][j]);
		}
		printf("\n");
	}
	for(int i=0;i<H;i++){
		int a=0;
		for(int j=0;j<W;j++){
			if(a[i][j]=='-'){
				a++;
			}
		}
		if(a==W){
			for(int l=i;l<H;l++){
				for(int j=0;j<W;j++){
					a[l][j]=a[l+1][j];
				}
			}
		}
		

	}

	for(int i=0;i<W;i++){
		int a=0;
		for(int j=0;j<H;j++){
			if(a[i][j]=='-'){
				a++;
			}
		}
		if(a==H){
			for(int l=i;l<W;l++){
				for(int j=0;j<H;j++){
					a[l][j]=a[l][j+1];
				}
			}
		}
	}
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			printf("%c",&a[i][j]);
		}
		printf("\n");
	}
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:29: error: subscripted value is neither array nor pointer nor vector
   19 |                         if(a[i][j]=='-'){
      |                             ^
main.c:26:42: error: subscripted value is neither array nor pointer nor vector
   26 |                                         a[l][j]=a[l+1][j];
      |                                          ^
main.c:26:50: error: subscripted value is neither array nor pointer nor vector
   26 |                                         a[l][j]=a[l+1][j];
      |                                                  ^
main.c:37:29: error: subscripted value is neither array nor pointer nor vector
   37 |                         if(a[i][j]=='-'){
      |                             ^
main.c:44:42: error: subscripted value is neither array nor pointer nor vector
   44 |                                         a[l][j]=a[l][j+1];
      |                                          ^
main.c:44:50: error: subscripted value is neither array nor pointer nor vector
   44 |                                         a[l][j]=a[l][j+1];
      |                                                  ^
Language: C

#include <stdio.h>


int main(void)
{
	int H,W;
	scanf("%d",&H);
	scanf("%d",&W);
	char a[H][W];
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			scanf("%c",&a[i][j]);
		}
		printf("\n");
	}
	for(int i=0;i<H;i++){
		int a=0;
		for(int j=0;j<W;j++){
			if(a[i][j]=='-'){
				a++;
			}
		}
		if(a==W){
			for(int l=i;l<H;l++){
				for(int j=0;j<W;j++){
					a[l][j]=a[l+1][j];
				}
			}
		}
		

	}

	for(int i=0;i<W;i++){
		int a=0;
		for(int j=0;j<H;j++){
			if(a[i][j]=='-'){
				a++;
			}
		}
		if(a==H){
			for(int l=i;l<W;l++){
				for(int j=0;j<H;j++){
					a[l][j]=a[l][j+1];
				}
			}
		}
	}
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			printf("%c",&a[i][j]);
		}
		printf("\n");
	}
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:29: error: subscripted value is neither array nor pointer nor vector
   19 |                         if(a[i][j]=='-'){
      |                             ^
main.c:26:42: error: subscripted value is neither array nor pointer nor vector
   26 |                                         a[l][j]=a[l+1][j];
      |                                          ^
main.c:26:50: error: subscripted value is neither array nor pointer nor vector
   26 |                                         a[l][j]=a[l+1][j];
      |                                                  ^
main.c:37:29: error: subscripted value is neither array nor pointer nor vector
   37 |                         if(a[i][j]=='-'){
      |                             ^
main.c:44:42: error: subscripted value is neither array nor pointer nor vector
   44 |                                         a[l][j]=a[l][j+1];
      |                                          ^
main.c:44:50: error: subscripted value is neither array nor pointer nor vector
   44 |                                         a[l][j]=a[l][j+1];
      |                                                  ^
Language: C++

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

using namespace std;

void deleteRow(int h, int w, vector <vector<string> > &a){
	for (int i=0; i<h; i++){
		int counter = 0;
		for (int j=0; j<w; j++){
			if(a[i][j] == "#") counter++;
		}
		if (counter==0){
			a.erase(a.begin() + i);
			i--;
		}
	}
	return;
}

void deleteCol(int h, int w, vector <vector<string> > &a){
	for (int j=0; j<w; j++){
		int counter = 0;
		for (int i=0; i<h; i++){
			if(a[i][j] == "#") counter++;
		}
		if (counter==0){
			for (int i=0; i<h; i++){
				a[i].erase(a[i].begin() + j);
			j--;
		}
	}
	return;
}

int main(){
	int h, w;
	string tmp;
	vector <vector<string> > a;
	cin >> h >> w;
	a.resize(h);
	for (int i=0; i<h; i++){
		a[i].resize(w);
		for (int j=0; j<w; j++){
			cin >> tmp;
			a[i][j] = tmp;
		}
	}
	deleteRow(h, w, a);
	deleteCol(a.size(), w, a);

	//print
	for (int i=0; i<a.size(); i++){
		for (int j=0; j<a[i].size(); j++){
			cout << a[i][j];
		}
		cout << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'void deleteCol(int, int, std::vector<std::vector<std::__cxx11::basic_string<char> > >&)':
a.cc:36:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   36 | int main(){
      |         ^~
a.cc:36:9: note: remove parentheses to default-initialize a variable
   36 | int main(){
      |         ^~
      |         --
a.cc:36:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:36:11: error: a function-definition is not allowed here before '{' token
   36 | int main(){
      |           ^
a.cc:60:2: error: expected '}' at end of input
   60 | }
      |  ^
a.cc:21:58: note: to match this '{'
   21 | void deleteCol(int h, int w, vector <vector<string> > &a){
      |                                                          ^