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

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

void replace_v(string& s)
{
  for (int i = 0; i < s.size(); ++i) s[i] = 'x';
}
void replace_h(vector<string> &s, int v)
{
  for (int i = 0; i < s.size(); ++i) s[i][v] = 'x';
}

int main()
{
  int h, w;
  cin >> h >> w;
  vector<string> a(h);
  for (int i = 0; i < h; ++i) cin >> a[i];
  
  for (int i = 0, k = 0; i < h; ++i, k = 0)
  {
    for (; k < w; ++k)
    {
      if (a[i][k] == '#') break;
    }
    if (k == w) replace_h(a[i]);
  }
  for (int k = 0, i = 0; k < w; ++k, i = 0)
  {
    for (; i < h; ++i)
    {
      if (a[i][k] == '#') break;
    }
    if (i == h) replace_v(a, k);
  }
  
  for (int i = 0; i < h; ++i)
  {
    for (int k = 0; k < w; ++k)
    {
      if (a[i][k] != 'x') cout << a[i][k];
    }
    cout << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:26: error: invalid initialization of reference of type 'std::vector<std::__cxx11::basic_string<char> >&' from expression of type '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'}
   26 |     if (k == w) replace_h(a[i]);
      |                 ~~~~~~~~~^~~~~~
a.cc:8:32: note: in passing argument 1 of 'void replace_h(std::vector<std::__cxx11::basic_string<char> >&, int)'
    8 | void replace_h(vector<string> &s, int v)
      |                ~~~~~~~~~~~~~~~~^
a.cc:34:27: error: invalid initialization of reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} from expression of type 'std::vector<std::__cxx11::basic_string<char> >'
   34 |     if (i == h) replace_v(a, k);
      |                           ^
a.cc:4:24: note: in passing argument 1 of 'void replace_v(std::string&)'
    4 | void replace_v(string& s)
      |                ~~~~~~~~^
Language: C++

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

int main(){
  int H, W;
  cin >> H >> W;
  vector<vector<char>> map(H, vector<char>(W));
  for (int i = 0; i < H; i++){
    for (int j = 0; j < W; j++){
      cin >> map.at(i).at(j);
     }
  }
  
  vector<bool> row(H, false);
  vector<bool> col(W, false);
  for (int i = 0; i < H; i++){
    for (int j = 0; j < W; j++){
      if(map.at(i).at(j) == '#'){
        row.at(i) = true;
        col.at(j) = true;
      }
    } 
  }
  
  for( int i= 0; i < H; i++){
    if(row.at(i)){
      for(int j = 0; j < W;j++){
        if(col.at(j){
          cout << map.at(i).at(j);
          } //if j
      }// for j
      cout << endl;
     }//if i
  } //for i
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:21: error: expected ')' before '{' token
   28 |         if(col.at(j){
      |           ~         ^
      |                     )
a.cc:31:7: error: expected primary-expression before '}' token
   31 |       }// for j
      |       ^
Language: C++

#include <iostream>
#include <numeric>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <map>
using namespace std;
using ll=long long;
#define rep(i,a,b) for(ll i=a;i<b;i++)
int main(){
    int h,w;
    cin>>h>>w;
    vector<string> s(h);
    rep(i,0,h){
        rep(j,0,w){
            cin>>s[i][j];
        }
    }
    int cnt1[h]=0,cnt2[w]=0;
    rep(i,0,h){
        rep(j,0,w) {
            if (s[i][j]=='#') {
                cnt1[i]++;//i行目は消えない
                cnt2[j]++;//j列目は消えない
            }
        }
    }
    rep(i,0,h){
        if(cnt1[i]!=0){
            rep(j,0,w){
                if(cnt2[j]!=0) cout<<s[i][j];
            }
        }
    cout<<endl;//1行出力→改行
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:17: error: array must be initialized with a brace-enclosed initializer
   21 |     int cnt1[h]=0,cnt2[w]=0;
      |                 ^
a.cc:21:27: error: array must be initialized with a brace-enclosed initializer
   21 |     int cnt1[h]=0,cnt2[w]=0;
      |                           ^
Language: C++

#include <iostream>
#include <numeric>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <map>
using namespace std;
using ll=long long;
#define rep(i,a,b) for(ll i=a;i<b;i++)
inline constexpr int intpow(ll a,ll b){
    if(b==0) return 1;
    ll ans=intpow(a,b/2);
    return ans*ans*(b&1?a:1);
}
int main(){
    int h,w;
    cin>>h>>w;
    vector<vector<char>> v(h,vector<char>(w));
    rep(i,0,h){
        rep(j,0,w){
            cin>>v[i][j];
        }
    }
    int l=0;
    rep(i,0,h){
        int cnt=0;
        rep(j,0,w) {
            if (v[i][j]=='#') cnt++;
        }
        if(cnt==w) {
            v.erase(v.begin(),v.begin()+w-1);
            l++;
        }
    }
    int m=0;
    rep(j,0,w){
        int cnt=0;
        rep(i,0,h-l){
            if (v[i][j]=='#') cnt++;
        }
        if(cnt==h-l) {
            rep(i,0,h-l){
                v.erase(v.begin()+i*w+j-1);
            }
            m++;
        }
    }
    rep(i,0,h-l){
        rep(j,0,w-m){
            cout<<v[i][j];
        }
    cout<<\n;
    }
}


Compiler output:
a.cc:54:11: error: stray '\' in program
   54 |     cout<<\n;
      |           ^
a.cc: In function 'int main()':
a.cc:54:12: error: 'n' was not declared in this scope
   54 |     cout<<\n;
      |            ^
Language: C++

#include <iostream>
#include <numeric>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <map>
using namespace std;
using ll=long long;
#define rep(i,a,b) for(ll i=a;i<b;i++)
inline constexpr int intpow(ll a,ll b){
    if(b==0) return 1;
    ll ans=intpow(a,b/2);
    return ans*ans*(b&1?a:1);
}
int main(){
    int h,w;
    cin>>h>>w;
    vector<vector<char>> v(h,vector<char>(w));
    rep(i,0,h){
        rep(j,0,w){
            cin>>v[i][j];
        }
    }
    int l=0;
    rep(i,0,h){
        int cnt=0;
        rep(j,0,w) {
            if (v[i][j]=='#') cnt++;
        }
        if(cnt==w) {
            v.erase(v.begin(),v.begin()+w-1);
            l++;
        }
    }
    int m=0;
    rep(j,0,w){
        int cnt=0;
        rep(i,0,h-l){
            if (v[i][j]=='#') cnt++;
        }
        if(cnt==h-l) {
            rep(i,0,h-l){
                v.erase(v.begin()+i*w+j-1);
            }
            m++;
        }
    }
    rep(i,0,h-l){
        rep(j,0,w-m){
            cout<<v[i][j];
        }
    cout<</n;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:54:11: error: expected primary-expression before '/' token
   54 |     cout<</n;
      |           ^
a.cc:54:12: error: 'n' was not declared in this scope
   54 |     cout<</n;
      |            ^
Language: C++

H,W = map(int,input().split())
a = [''] * H
for i in range(H):
	a[i] = input()
	
row = [False] * H
col = [False] * W 

for i in range(H):
	for j in range(W):
		if a[i][j] == '#':
			row[i] = True
			col[j] = True

for i in range(H):
	if row[i]:
		for j in range(W):
			if col[j]:
				print(a[i][j], end = '')
		print()


Compiler output:
a.cc:2:6: error: empty character constant
    2 | a = [''] * H
      |      ^~
a.cc:19:54: error: empty character constant
   19 |                                 print(a[i][j], end = '')
      |                                                      ^~
a.cc:1:1: error: 'H' does not name a type
    1 | H,W = map(int,input().split())
      | ^
Language: C++

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

main(){
    int H,W;
    cin >> H >> W;
    vector<vector<char>> grid(H,vector<char>(W));
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            cin >> grid.at(i).at(j);
        }
    }

    vector<bool> lineall(H,0), rowall(W,0);

    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            if(grid.at(i).at(j)=='#'){
                lineall.at(i) = 1;
             　 break;
            }
        }
    }
    for(int i=0;i<W;i++){
        for(int j=0;j<H;j++){
            if(grid.at(j).at(i)=='#'){
                rowall.at(i) = 1;
                break;
            }
        }
    }

    for(int i=0;i<H;i++){
        if(lineall.at(i)==1){
            for(int j=0;j<W;j++){
                if(rowall.at(j)==1){
                    cout << grid.at(i).at(j);
                }
            }
            cout<<endl;
        }
    }
}




Compiler output:
a.cc:20:14: error: extended character 　 is not valid in an identifier
   20 |              　 break;
      |              ^
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:20:14: error: '\U00003000' was not declared in this scope
   20 |              　 break;
      |              ^~
Language: C++

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

main(){
    int H,W;
    cin >> H >> W;
    vector<vector<char>> grid(H,vector<char>(W));
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            cin >> grid.at(i).at(j);
        }
    }

    vector<bool> lineall(H,0), rowall(W,0);

    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            if(grid.at(i).at(j)=='#'){
                lineall.at(i) = 1;
            }
            break;
        }
    }
    for(int i=0;i<W;i++){
        for(int j=0;j<H;j++){
            if(grid.at(j).at(i)=='#'){
                rowall.at(i) = 1;
            }
            break;
        }
    }

    for(i=0;i<H;i++){
        if(lineall.at(i)==1){
            for(j=0;j<W;j++){
                if(rowall.at(j)==1){
                    cout << grid.at(i).at(j);
                }
            }
            cout<<endl;
        }
    }
}




Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:33:9: error: 'i' was not declared in this scope
   33 |     for(i=0;i<H;i++){
      |         ^
a.cc:35:17: error: 'j' was not declared in this scope
   35 |             for(j=0;j<W;j++){
      |                 ^
Language: C++

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

int main()
{
    int h, w;
    cin >> h >> w;
    vector<string> a;
    for (int i = 0; i < h; i++)
    {
        string stg;
        cin >> stg;
        if (count(stg.begin(), stg.end(), '.') < w)
        {
            a.push_back(stg);
        }
    }
    h = a.size();
    for (int i = 0; i < w; i++)
    {
        int siro = 0;
        for (int j = 0; j < h; j++)
        {
            if (a.at(j)[i] == '.')
            {
                siro++;
            }
        }
        if (siro == h)
        {
            for (int j = 0; j < h; j++)
            {
                a.at(j).erase(a.at(j).begin() + i);
            }
            i--;
            w--;
        }
    }
    for (int i = 0; i < h; i++)
    {
        cout << a.at(i) << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: 'count' was not declared in this scope
   15 |         if (count(stg.begin(), stg.end(), '.') < w)
      |             ^~~~~
Language: C

#include <stdio.h>
int main(){
    int h,w;
    scanf("%d%d",&h,&w);
    char field[h][w];
    int checkh[h],chackw[w];
    for (int i=0;i<h;i++){
        scanf("%c",&field[i][0]);
        for (int j=0;j<w;j++){
            scanf("%c",&field[i][j]);
        }
    }
    for (int i=0;i<h;i++){
        checkh[i]=0;
        for (int j=0;j<w;j++){
            if (field[i][j]=='#'){
                checkh[i]=1;
                break;
            }
        }
        if (check[i]==1){
            break;
        }
    }
    for (int j=0;j<w;j++){
        checkw[j]=0;
        for (int i=0;i<h;i++){
            if (field[i][j]=='#'){
                checkw[j]=1;
                break;
            }
        }
        if (checkw[j]==1){
            break;
        }
    }
    for (int i=0;i<h && checkh[i];i++){
        for (int j=0;j<w checkw[j];j++){
            printf("%c",field[i][j]);
        }
        printf("\n");
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:21:13: error: 'check' undeclared (first use in this function); did you mean 'checkh'?
   21 |         if (check[i]==1){
      |             ^~~~~
      |             checkh
main.c:21:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:26:9: error: 'checkw' undeclared (first use in this function); did you mean 'chackw'?
   26 |         checkw[j]=0;
      |         ^~~~~~
      |         chackw
main.c:38:25: error: expected ';' before 'checkw'
   38 |         for (int j=0;j<w checkw[j];j++){
      |                         ^~~~~~~
      |                         ;
Language: C++

#include <bits/stdc++.h>
using namespace std;;
int main () {
  int H, W;
  cin >> H >> W;
  vector<vector<int>> data(H, vector<int> (W,3));
  vector<int> hdata(H,0),wdata(W,0);
  for(int i = 0; i < H; i++) {
    char a , b = ' ';
    int count = 0;
    for(int j = 0; j < W; j++) {
      cin >> a;
      if (a == '.') data.at(i).at(j) = 0;
      eles data.at(i).at(j) = 1;
      if (a == '.' && a == b) count++;
      b = a;
      if (count == W - 1) hdata.at(i) = 1;
    }
  }
  for(int i = 0; i < W; i++) {
    int a , b = -1;
    int count = 0;
    for(int j = 0; j < H; j++) {
      a = data.at(j).at(i);
      if (a == 0 && a == b) count++;
      b = a;
      if (count == H - 1) wdata.at(i) = 1;
    }
  }
  for(int i = 0; i < H; i++) {
    if (hdata.at(i) == 1) continue;
    for(int j = 0; j < W; j++) {
      if (wdata.at(i) == 1) continue;
      if(data.at(i).at(j) == 0) cout << '.';
      else cout << '#';
    }
    cout << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:7: error: 'eles' was not declared in this scope
   14 |       eles data.at(i).at(j) = 1;
      |       ^~~~
Language: C++

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

int main(){
  int H, W;
  cin >> H >> W;
  vector<int> h_flg(H);
  vector<int> w_fig(W);
  vector<vector<char>> data(H,vector<char>(W));
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      char tmp;
      cin >> tmp;
      h_flg.at(i) += (tmp=='#');
      w_flg.at(j) += (tmp=='#');
      data.at(i).at(j) = tmp;
    }
  }
  int new_h = 0;
  int new_w = 0;
  for (int i = 0; i < H; i++) {
    new_h += h_f
  }
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      if (h_flg.at(i) && w_flg.at(j)){
        cout << data.at(i).at(j);
      }
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:7: error: 'w_flg' was not declared in this scope; did you mean 'w_fig'?
   15 |       w_flg.at(j) += (tmp=='#');
      |       ^~~~~
      |       w_fig
a.cc:22:14: error: 'h_f' was not declared in this scope; did you mean 'h_flg'?
   22 |     new_h += h_f
      |              ^~~
      |              h_flg
a.cc:26:26: error: 'w_flg' was not declared in this scope; did you mean 'w_fig'?
   26 |       if (h_flg.at(i) && w_flg.at(j)){
      |                          ^~~~~
      |                          w_fig
Language: C++

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

using namespace std;

int main() {
    int h, w;
    cin >> h >> w;

    vector<string> a;
    for (int i = 0; i < h; ++i) {
        string tmp;
        cin >> tmp;
        if (tmp.find("#") != string::npos)
            a.push_back(tmp);
    }

    vector<int> ignore_columns;
    for (int col = 0; col < w; ++col) {
        bool only_white = true;
        for (int row = 0; row < a.size(); ++row) {
            if (a[row][col] == '#') {
                only_white = false;
                break;
            }
        }
        if (!only_white)
            ignore_columns.push_back(col);
    }

    for (int i = 0; i < a.size(); ++i) {
        for (int j = 0; j < w; ++j) {
            if (find(ignore_columns.begin(), ignore_columns.end(), j) !=
                ignore_columns.end())
                cout << a[i][j];
        }
        cout << '\n';
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:21: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   34 |             if (find(ignore_columns.begin(), ignore_columns.end(), j) !=
      |                 ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:34:21: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   34 |             if (find(ignore_columns.begin(), ignore_columns.end(), j) !=
      |                 ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main(){
  int h,w;
  cin>>h>>w;
  bool flag=false;
  vector<vector<string>> v;
  vector<string>temp(w);
  for(int i=0;i<h;i++){
    flag=false;
  for(int j=0;j<w;j++){
  string input;
    cin>>input;
    temp.push_back(input);
    if(input=="#")flag=true;
  }
    if(flag) v.push_back(temp);
    temp.clear();
  }
  return v;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:10: error: cannot convert 'std::vector<std::vector<std::__cxx11::basic_string<char> > >' to 'int' in return
   21 |   return v;
      |          ^
      |          |
      |          std::vector<std::vector<std::__cxx11::basic_string<char> > >
Language: C++

h, w = gets.split(" ").map{|n| n.to_i }
ans = h.times.map{
  gets.strip.split("")
}.reject{|row|
  row.all?{|d| d == "." }
}.transpose.reject{|col|
  col.all?{|d| d == "." }
}.transpose.each{|line|
  puts line.join
}


Compiler output:
a.cc:1:1: error: 'h' does not name a type
    1 | h, w = gets.split(" ").map{|n| n.to_i }
      | ^
a.cc:2:1: error: 'ans' does not name a type
    2 | ans = h.times.map{
      | ^~~
a.cc:4:2: error: expected unqualified-id before '.' token
    4 | }.reject{|row|
      |  ^
a.cc:6:2: error: expected unqualified-id before '.' token
    6 | }.transpose.reject{|col|
      |  ^
a.cc:8:2: error: expected unqualified-id before '.' token
    8 | }.transpose.each{|line|
      |  ^
Language: C++

height, width = (int(x) for x in input().split())
matrix = []

for i in range(height):
  matrix.append(input())

row = [0] * width
column = [0] * height

for i in range(height):
  if '#' in matrix[i]:
    column[i] = 1
    for j in range(width):
      if (matrix[i][j] == '#'):
        row[j] = 1

for i in range(height):
  if (column[i] == 1):
    for j in range(width):
      if (row[j] == 1):
        print(matrix[i][j], end = '')
    print()
        

Compiler output:
a.cc:21:35: error: empty character constant
   21 |         print(matrix[i][j], end = '')
      |                                   ^~
a.cc:1:1: error: 'height' does not name a type
    1 | height, width = (int(x) for x in input().split())
      | ^~~~~~
Language: Java

/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
	Scanner sc = new Scanner(System.in);
	int h = sc.nextInt(),w=sc.nextInt();
	
	char[][] map = new char[h][w];
	for(int i = 0; i < h; i++) {
	     for(int j = 0; j < w; j++) {
	         map[i][j]=sc.nextchar();
	     }
	}

HashSet<Integer>  yset = new HashSet<>(),xset=new HashSet<>();
	IntStream.range(0,100).forEach(i -> {
	    yset.add(i);
	    xset.add(i);
	});

	for(int y = 0;y<h;y++) {
 if(Arrays.stream(map[y]).allMatch(c->c=='.')) yset.remove(y);
} 
for(int x = 0; x < w;x++){
for(int y = 0;y < h; y++){
if(map[y][x]!='#'){
xset.remove(x);
break;
}
}
}
yset.stream().forEach(y-> {
xset.stream().forEach(x-> System.out.print(map[y][x]));
System.out.println();
}
	}
}

Compiler output:
Main.java:42: error: ')' or ',' expected
}
 ^
1 error
Language: Java

/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
	Scanner sc = new Scanner(System.in);
	int h = sc.nextInt(),w=sc.nextInt();
	
	char[][] map = new char[h][w];
	for(int i = 0; i < h; i++) {
	     for(int j = 0; j < w; j++) {
	         map[i][j]=sc.nextchar();
	     }
	}

HashSet<Integer>  yset = new HashSet<>,xset=new HashSet<>;
	IntStream.range(0,100).forEach(i -> {
	    yset.add(i);
	    xset.add(i);
	});

	for(int y = 0;y<h;y++) {
 if(Arrays.stream(map[y]).allMatch(c->c=='.')) yset.remove(y);
} 
for(int x = 0; x < w;x++){
for(int y = 0;y < h; y++){
if(map[y][x]!='#'){
xset.remove(x);
break;
}
}
}
yset.stream().forEach(y-> {
xset.stream().forEach(x-> System.out.print(map[y][x]));
System.out.println();
}
	}
}

Compiler output:
Main.java:22: error: '(' or '[' expected
HashSet<Integer>  yset = new HashSet<>,xset=new HashSet<>;
                                      ^
Main.java:22: error: '(' or '[' expected
HashSet<Integer>  yset = new HashSet<>,xset=new HashSet<>;
                                                         ^
Main.java:42: error: ')' or ',' expected
}
 ^
3 errors
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<N;i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
const int NIF = 1000000000, MOD = 1e9 + 7;
int main() {
	int h, w;
	cin >> h >> w;
	char c[h][w];
	rep(i, h) rep(j, w) cin >> c[i][j];
	int hh[h] = {}, ww[w] = {};
	rep(i, h)rep(j, w) {
		if (C[i][j] == '#') hh[i] = 1;
	}
	rep(i, w)rep(j, h) {
		if (c[i][j] == '#') ww[i] = 1;
	}
	rep(i, h) {
		bool flg = 0;
		rep(j, w) {
			if (!hh[i] || !ww[j]) continue;
			cout << c[i][j];
			flg = 1;
		}
		if (flg) cout << endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:2:32: error: 'N' was not declared in this scope
    2 | #define rep(i,n) for(int i=0;i<N;i++)
      |                                ^
a.cc:10:9: note: in expansion of macro 'rep'
   10 |         rep(i, h) rep(j, w) cin >> c[i][j];
      |         ^~~
a.cc:2:32: error: 'N' was not declared in this scope
    2 | #define rep(i,n) for(int i=0;i<N;i++)
      |                                ^
a.cc:12:9: note: in expansion of macro 'rep'
   12 |         rep(i, h)rep(j, w) {
      |         ^~~
a.cc:13:21: error: 'C' was not declared in this scope
   13 |                 if (C[i][j] == '#') hh[i] = 1;
      |                     ^
a.cc:2:32: error: 'N' was not declared in this scope
    2 | #define rep(i,n) for(int i=0;i<N;i++)
      |                                ^
a.cc:15:9: note: in expansion of macro 'rep'
   15 |         rep(i, w)rep(j, h) {
      |         ^~~
a.cc:2:32: error: 'N' was not declared in this scope
    2 | #define rep(i,n) for(int i=0;i<N;i++)
      |                                ^
a.cc:18:9: note: in expansion of macro 'rep'
   18 |         rep(i, h) {
      |         ^~~
Language: C++

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

int H, W;
char a[H][W];

int main()
{
    cin >> H >> W;
    for (int i = 0; i < H; i++){
        for (int j = 0; j < W; j++){
            cin >> a[i][j];
        }
    }

    //判定用
    vector<bool> row(H, false);
    vector<bool> col(W, false);

    for (int i = 0; i < H; i++){
        for (int j = 0; j < W; j++){
            if (a[i][j] == '#'){
                row[i] = true;
                con[j] = true;
            }
        }
    }

    for (int i = 0; i < H; i++){
        if (row[i]){
            for (int j = 0; j < W; j++){
                if (col[j]){
                    cout << a[i][j];
                }
            }
            cout << endl;
        }
    }
}

Compiler output:
a.cc:6:11: error: size of array 'a' is not an integral constant-expression
    6 | char a[H][W];
      |           ^
a.cc:6:8: error: size of array 'a' is not an integral constant-expression
    6 | char a[H][W];
      |        ^
a.cc: In function 'int main()':
a.cc:25:17: error: 'con' was not declared in this scope; did you mean 'col'?
   25 |                 con[j] = true;
      |                 ^~~
      |                 col
Language: C++

#include <iostream>

using namespace std;

int H, W;
char a[H][W];

int main()
{
    cin >> H >> W;
    for (int i = 0; i < H; i++){
        for (int j = 0; j < W; j++){
            cin >> a[i][j];
        }
    }

    //判定用
    vector<bool> row(H, false);
    vector<bool> col(W, false);

    for (int i = 0; i < H; i++){
        for (int j = 0; j < W; j++){
            if (a[i][j] == '#'){
                row[i] = true;
                con[j] = true;
            }
        }
    }

    for (int i = 0; i < H; i++){
        if (row[i]){
            for (int j = 0; j < W; j++){
                if (col[j]){
                    cout << a[i][j];
                }
            }
            cout << endl;
        }
    }
}

Compiler output:
a.cc:6:11: error: size of array 'a' is not an integral constant-expression
    6 | char a[H][W];
      |           ^
a.cc:6:8: error: size of array 'a' is not an integral constant-expression
    6 | char a[H][W];
      |        ^
a.cc: In function 'int main()':
a.cc:18:5: error: 'vector' was not declared in this scope
   18 |     vector<bool> row(H, false);
      |     ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | 
a.cc:18:12: error: expected primary-expression before 'bool'
   18 |     vector<bool> row(H, false);
      |            ^~~~
a.cc:19:12: error: expected primary-expression before 'bool'
   19 |     vector<bool> col(W, false);
      |            ^~~~
a.cc:24:17: error: 'row' was not declared in this scope
   24 |                 row[i] = true;
      |                 ^~~
a.cc:25:17: error: 'con' was not declared in this scope
   25 |                 con[j] = true;
      |                 ^~~
a.cc:31:13: error: 'row' was not declared in this scope
   31 |         if (row[i]){
      |             ^~~
a.cc:33:21: error: 'col' was not declared in this scope
   33 |                 if (col[j]){
      |                     ^~~
Language: C++

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

int main(){
  int h;cin>>h;
  int w;cin>>w;
  vector<string> a(h);
  for (int i = 0; i < h; i++) {
  cin >> a[i];
}

vector<bool> row(h, false);
vector<bool> col(w, false);
for (int i = 0; i < h; i++) {
  for (int j = 0; j < w; j++) {
    if (a[i][j] == '#') {
      row[i] = true;
      col[j] = true;
    }
  }
}

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

Compiler output:
a.cc:36:1: error: expected declaration before '}' token
   36 | }
      | ^
Language: C++

h,w=map(int, input().split())
a=['']*h
for i in range(h):
    a[i]=input()

row=[False]*h
col=[False]*w
for i in range(h):
    for j in range(w):
        if a[i][j]=='#':
            row[i]=True
            col[j]=True

for i in range(h):
    if row[i]:
        for j in range(w):
            if col[j]:
                print(a[i][j],end='')
        print()

Compiler output:
a.cc:2:4: error: empty character constant
    2 | a=['']*h
      |    ^~
a.cc:18:35: error: empty character constant
   18 |                 print(a[i][j],end='')
      |                                   ^~
a.cc:1:1: error: 'h' does not name a type
    1 | h,w=map(int, input().split())
      | ^
Language: C++

import java.util.Arrays;
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int h = scan.nextInt();
        int w = scan.nextInt();scan.nextLine();
        char[][] c = new char[h][w];
        for (int i = 0; i < h; i++) {
            String s = scan.nextLine();
            for(int j = 0; j < w; j++) {
                c[i][j] = s.charAt(j);
            }
        }
        boolean[] tate = new boolean[h];
        boolean[] yoko = new boolean[w];
        Arrays.fill(tate, true);
        Arrays.fill(yoko, true);
        for(int i = 0; i < h; i++) {
            for(int j = 0; j < w; j++) {
                if (c[i][j] != '.') {
                    tate[i] = false;
                }
            }
        }
        for (int i = 0; i < w; i++) {
            for (int j = 0; j < h; j++) {
                if (c[j][i] != '.') {
                    yoko[i] = false;
                }
            }
        }
        for(int i = 0; i < h; i++) {
            for(int j = 0; j < w; j++) {
                if (tate[i]) continue;
                if (yoko[j]) continue;
                System.out.print(c[i][j]);
                if (j == w-1) System.out.println();
            }
        }
    }
}

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

#include <iostream>
    #include <string>
    #include <vector>
    using namespace std;
     
    int main() {
    	int H,W;
    	cin >> H >> W;
    	vector<string> board(H);
    	for (int i = 0; i < H; i++) {
    		cin >> board[i];
    	}
     
    	vector<bool> row(H, false);
    	vector<bool> col(W, false);
    	for (int i = 0; i < H; i++) {
    		for (int j = 0; j < W; j++) {
    			if (board[i][j] == '#') {
    				row[i] = true;
    				col[j] = true;
    			}
    		}
    	}
     
    	for (int i = 0; i < H; i++) {
    		if (row[i]) {
    			for (int j = 0; j < W; j++) {
    				if (col[j]) {
    					cout << a[i][j];
    				}
    			}
    			cout << endl;
    		}
    	}
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:29:49: error: 'a' was not declared in this scope
   29 |                                         cout << a[i][j];
      |                                                 ^
Language: C

n = list(map(int, input().split()))
H, W = n[0], n[1]
li = [['.' for i in range(W)] for i in range(H)]

for i in range(H):
    l = input()
    for j in range(len(l)):
        li[i][j] = l[j]

pos = []
# horizontal check
for i in range(H):
    c = 0
    for j in range(W):
        if li[i][j] == '.':
            c += 1
    if c == W:
        pos.append(i)

j = 0
for i in range(len(pos)):
    li.pop(pos[i]-j)
    j += 1


pos = []
# vertical check
for i in range(len(li[0])):
    c = 0
    for j in range(len(li)):
        if li[j][i] == '.':
            c += 1
    if c == len(li):
        pos.append(i)

for i in range(len(li)):
    m = 0
    for x in range(len(pos)):
        li[i].pop(pos[x]-m)
        m += 1

for i in range(len(li)):
    print("".join(li[i]))


Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | n = list(map(int, input().split()))
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:1:5: error: implicit declaration of function 'list' [-Wimplicit-function-declaration]
    1 | n = list(map(int, input().split()))
      |     ^~~~
main.c:1:10: error: implicit declaration of function 'map' [-Wimplicit-function-declaration]
    1 | n = list(map(int, input().split()))
      |          ^~~
main.c:1:14: error: expected expression before 'int'
    1 | n = list(map(int, input().split()))
      |              ^~~
main.c:2:1: error: expected ',' or ';' before 'H'
    2 | H, W = n[0], n[1]
      | ^
main.c:11:3: error: invalid preprocessing directive #horizontal
   11 | # horizontal check
      |   ^~~~~~~~~~
main.c:27:3: error: invalid preprocessing directive #vertical
   27 | # vertical check
      |   ^~~~~~~~
Language: C++

using namespace std;
int r[100],c[100];
int main(){
  int H,W;
  cin>>H>>W;
  string str[100];
  int i=0,j=0;
  while(i<H){
    j=0;
    cin>>str[i];
    while(j<W){
      str[i][j]=='#';
      r[i]++;
      c[j]++;
      j++;
    }
    i++;
  }
  i=0;
  while(i<H){
    j=0;
    while(j<W){
      if(!r[i]&&!c[j])cout<<str[i][j];
      j++;
    }
    i++;
    cout<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin>>H>>W;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string str[100];
      |   ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | using namespace std;
a.cc:10:10: error: 'str' was not declared in this scope; did you mean 'std'?
   10 |     cin>>str[i];
      |          ^~~
      |          std
a.cc:23:23: error: 'cout' was not declared in this scope
   23 |       if(!r[i]&&!c[j])cout<<str[i][j];
      |                       ^~~~
a.cc:23:23: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:29: error: 'str' was not declared in this scope; did you mean 'std'?
   23 |       if(!r[i]&&!c[j])cout<<str[i][j];
      |                             ^~~
      |                             std
a.cc:27:5: error: 'cout' was not declared in this scope
   27 |     cout<<endl;
      |     ^~~~
a.cc:27:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:27:11: error: 'endl' was not declared in this scope
   27 |     cout<<endl;
      |           ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

using namespace std;
int r[100],c[100];
int main(){
  int H,W;
  cin>>H>>W;
  string str[100];
  int i=0,j=0;
  while(i<H){
    j=0;
    cin>>str[i];
    while(j<W){
      str[i][j]=='#';
      r[i]++;
      c[j]++;
    }
  }
  i=0;
  while(i<H){
    j=0;
    while(j<W){
      if(!r[i]&&!c[j])cout<<str[i][j];
    }
    cout<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin>>H>>W;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string str[100];
      |   ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | using namespace std;
a.cc:10:10: error: 'str' was not declared in this scope; did you mean 'std'?
   10 |     cin>>str[i];
      |          ^~~
      |          std
a.cc:21:23: error: 'cout' was not declared in this scope
   21 |       if(!r[i]&&!c[j])cout<<str[i][j];
      |                       ^~~~
a.cc:21:23: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:21:29: error: 'str' was not declared in this scope; did you mean 'std'?
   21 |       if(!r[i]&&!c[j])cout<<str[i][j];
      |                             ^~~
      |                             std
a.cc:23:5: error: 'cout' was not declared in this scope
   23 |     cout<<endl;
      |     ^~~~
a.cc:23:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:11: error: 'endl' was not declared in this scope
   23 |     cout<<endl;
      |           ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

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

int main(){
string a[100];
int H,W,b[100]={0},c[100]={0};

cin >> H >> W;
for(int i=0;i<H;i++){
cin >> a[i];
}
for(int i=0;i<H;i++){
	for(int p=0;p<W;p++){
		if(a[i][p]==".")b[i]++;
	}
	if(b[i]==p)a[i]="H";
}
b[]={0};
for(int i=0;i<W;i++){
	for(int p=0;p<H;p++){
		if(a[i][p]==".")c[i]++;
	}
	if(c[i]==p)for(int u=0;u<H;p++){
		a[i][u]="H";
	}
}
for(int i=0;i<W;i++){
for(int u=0;u<H;u++){

if(a[i][u]=="H")
else cout << a[i][u];
}
cout << endl;
}


return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |                 if(a[i][p]==".")b[i]++;
a.cc:17:18: error: 'p' was not declared in this scope
   17 |         if(b[i]==p)a[i]="H";
      |                  ^
a.cc:19:3: error: expected primary-expression before ']' token
   19 | b[]={0};
      |   ^
a.cc:22:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   22 |                 if(a[i][p]==".")c[i]++;
a.cc:24:18: error: 'p' was not declared in this scope
   24 |         if(c[i]==p)for(int u=0;u<H;p++){
      |                  ^
a.cc:25:25: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   25 |                 a[i][u]="H";
      |                         ^~~
      |                         |
      |                         const char*
a.cc:31:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   31 | if(a[i][u]=="H")
a.cc:32:1: error: expected primary-expression before 'else'
   32 | else cout << a[i][u];
      | ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int h,w;
  cin>>h>>w;
  char c[h][w];
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      cin>>c[i][j];
    }
  }
  for(int i=0;i<w;i++){
    bool a=true;
    for(int j=0;j<h;j++){
      if(c[j][i]=='#')
        a=false;
    }
    if(a){
      for(j=0;j<h;j++){
        c[j][i]='%';
      }
    }
  }
  for(int i=0;i<h;i++){
    bool a=true;
    for(int j=0;j<w;j++){
      if(c[i][j]=='#')
        a=false;
    }
    if(a){
      c[i][0]='d';
    }
  }
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      if(c[i][j]=='d')
        break;
      else if(c[i][j]!='%')
        cout<<c[i][j];
    }
    cout<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:11: error: 'j' was not declared in this scope
   19 |       for(j=0;j<h;j++){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int h,w;
  cin>>h>>w;
  char c[h][w];
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      cin>>c[i][j];
    }
  }
  for(int i=0;i<w;i++){
    bool a=true;
    for(int j=0;j<h;j++){
      if(c[j][i]=='#')
        a=false;
    }
    if(a){
      for(j=0;j<h;j++){
        c[j][i]='%';
      }
    }
  }
      

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

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

bool a[200],b[200];
int main(){
    int n,m;
    cin>>n>>m;
    string s[n];
    rep(i,n){
        cin>>s[i];
        rep(j,m){
            a[i]=a[i]||{s[i][j]=='#'};
            b[j]=b[j]||{s[i][j]=='#'};
        }
    }
    rep(i,n){
        rep(j,m){
        if(a[i]&&b[j])cout<<s[i][j];
        }
        if(a[i])cout<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:24: error: expected primary-expression before '{' token
   33 |             a[i]=a[i]||{s[i][j]=='#'};
      |                        ^
a.cc:34:24: error: expected primary-expression before '{' token
   34 |             b[j]=b[j]||{s[i][j]=='#'};
      |                        ^
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

bool a[200],b[200];
int main(){
    int n,m;
    cin>>n>>m;
    string s[n];
    rep(i,n){
        cin>>s[i];
        rep(j,m){
            a[i]||={s[i][j]=='#'};
            b[j]||={s[i][j]=='#'};
        }
    }
    rep(i,n){
        rep(j,m){
        if(a[i]&&b[j])cout<<s[i][j];
        }
        if(a[i])cout<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:19: error: expected primary-expression before '=' token
   33 |             a[i]||={s[i][j]=='#'};
      |                   ^
a.cc:34:19: error: expected primary-expression before '=' token
   34 |             b[j]||={s[i][j]=='#'};
      |                   ^
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

bool a[200],b[200];
int main(){
    int n,m;
    cin>>n>>m;
    string s[n];
    rep(i,n){
        cin>>s[i];
        rep(j,m){
            a[i]|={s[i][j]=='#'};
            b[j]|={s[i][j]=='#'};
        }
    }
    rep(i,n){
        rep(j,m){
        if(a[i]&&b[j])cout<<s[i][j];
        }
        if(a[i])cout<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:32: error: invalid use of brace-enclosed initializer list
   33 |             a[i]|={s[i][j]=='#'};
      |                                ^
a.cc:34:32: error: invalid use of brace-enclosed initializer list
   34 |             b[j]|={s[i][j]=='#'};
      |                                ^
Language: C++

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

int main(){
  int H, W;
  std::cin>>H>>W;
  std::vector<std::string> a(H);

  for(auto i = a.begin();i != a.end();i++){
    std::cin>>*i;
  }

  std::vector<bool> row(H, false);
  std::vector<bool> col(W, false);
  for(int i = 0;i < H;i++){
    for(int j = 0; j < W;j++){
      if(a[i][j] == '#'){
        row[i] = true;
        col[j] = true;
      }
    }
  }
  for(int i = 0;i < H;i++){
    if(row[i]){
      for(int j = 0;j < W;j++){
        if(col[j]){
          std::cout<<a[i][j];
        }
      }
      std::cout<<std::endl;
    }
  }
  return 0;
}#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

int main(){
  int H, W;
  std::cin>>H>>W;
  std::vector<std::string> a(H);

  for(auto i = a.begin();i != a.end();i++){
    std::cin>>*i;
  }

  std::vector<bool> row(H, false);
  std::vector<bool> col(W, false);
  for(int i = 0;i < H;i++){
    for(int j = 0; j < W;j++){
      if(a[i][j] == '#'){
        row[i] = true;
        col[j] = true;
      }
    }
  }
  for(int i = 0;i < H;i++){
    if(row[i]){
      for(int j = 0;j < W;j++){
        if(col[j]){
          std::cout<<a[i][j];
        }
      }
      std::cout<<std::endl;
    }
  }
  return 0;
}

Compiler output:
a.cc:36:2: error: stray '#' in program
   36 | }#include <iostream>
      |  ^
a.cc:36:3: error: 'include' does not name a type
   36 | }#include <iostream>
      |   ^~~~~~~
Language: C++

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

int main() {
  int H,W;
  cin>>H>>W;
  
  string a[110];
  bool goodx[110];
  bool goody[110];
  
  for(int i=0;i<H;++i){
    cin>>a[i];
  }
  
  for(int i=0;i<H){
    for(int j=0;j<W;++j){
      if(a[i][j]=='#'){
        goodx[i]=true;
        goody[j]=true;
      }
    }
  }
  
  for(int i=0;i<H;++i){
    if(goodx){
      for(int j=0;j<W;++j){
        if(goody){
          cout<<a[i][j];
        }
      }
    }
    cout<<endl;
  }
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:18: error: expected ';' before ')' token
   18 |   for(int i=0;i<H){
      |                  ^
      |                  ;
Language: C++

#include<cstdio>
#include<algorithm>
using namespace std;
int n,m;
char Map[105][105];
bool VisLine[105],VisRow[105];
int main(){
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++){
		int sum=0;
		gets(Map[i])
		for(int j=0;j<m;j++){
			sum+=(Map[i][j]=='#');
		}
		if(sum==0)VisRow[i]=1;
	}
	for(int i=0;i<m;i++){
		int sum=0;
		for(int  j=1;j<=n;j++){
			sum+=(Map[j][i]=='#');
		}
		if(sum==0)VisLine[i]=1;
	}
	for(int i=1;i<=n;i++){
		for(int j=0;j<m;j++){
			if(!VisLine[j]&&!VisRow[i])printf("%c",Map[i][j]);
		}
		printf("\n");
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'gets' was not declared in this scope; did you mean 'getw'?
   11 |                 gets(Map[i])
      |                 ^~~~
      |                 getw
a.cc:12:29: error: 'j' was not declared in this scope
   12 |                 for(int j=0;j<m;j++){
      |                             ^
Language: C++

#include <iostream>
using namespace std;
int h,w,cnt,Cnt,p,P;
int main() {
	cnt=0;
	Cnt=0;
  p=0;P=0;
	cin>>h>>w;
	char a[h][w];
	int b[h]={0};
	int c[w]={0};
	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-1;j++){
			if(a[i][j]!=a[i][j+1]||a[i][j]=='#'){
				break;
			}else if(j==w-2){
				b[i]=1;
				cnt++;
			}
		}
	}
	for(int j=0;j<w;j++){
		for(int i=0;i<h-1;i++){
			if(a[i][j]!=a[i+1][j]||a[i][j]=='#'){
				break;
			}else if(i==h-2){
				c[j]=1;
				Cnt++;
			}
		}
	}
	for(int i=0;i<h;i++){
		if(b[i]==0){
          p++;
		for(int j=0;j<w;j++){
			if(c[j]==0){
              P++;
				cout<<a[i][j];
				//if(Cnt!=w-P)cout<<" ";
              else if(cnt!=h-p)cout<<endl;
			}
		}
		P=0;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:15: error: expected '}' before 'else'
   45 |               else if(cnt!=h-p)cout<<endl;
      |               ^~~~
a.cc:41:36: note: to match this '{'
   41 |                         if(c[j]==0){
      |                                    ^
a.cc: At global scope:
a.cc:51:9: error: expected unqualified-id before 'return'
   51 |         return 0;
      |         ^~~~~~
a.cc:52:1: error: expected declaration before '}' token
   52 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
char a[102][102], usedh[102], usedw[102];
int main(){
    int h, w;
    scanf("%d %d", &h, &w);
    gets(a[0]);
    for(int i = 1; i <= h; i++){
        gets(a[i] + 1);
    }
    for(int i = 1; i <= h; i++){
        bool flag = 0;
        for(int j = 1; j <= w; j++){
            if(a[i][j] == '#') flag = 1;
        }
        if(flag == 0){
            usedh[i] = 1;
        }
    }
    for(int j = 1; j <= w; j++){
        bool flag = 0;
        for(int i = 1; i <= h; i++){
            if(a[i][j] == '#') flag = 1;
        }
        if(flag == 0){
            usedw[j] = 1;
        }
    }
    for(int i = 1; i <= h; i++){
        if(usedh[i]) continue;
        for(int j = 1; j <= w; j++){
            if(usedw[j]) continue;
            printf("%c", a[i][j]);
        }
        printf("\n");
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    7 |     gets(a[0]);
      |     ^~~~
      |     getw