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

#include <bits/stdc++.h>

#include <cstdlib>  // abs() for integer 絶対値求めやつ

#include <cmath>    // abs() for float, and fabs()

#include <algorithm>
#include <vector>
#define rep(i,n) for(int i = 0; i< (n);i++)

#define SORT(a) sort((a).begin(),(a).end());

#define che(a,string) cout<<string<<":"<<(a)<<endl;

#define ch(a,string) cout<<string<<":"<<(a)<<" ";

using namespace std;

typedef pair<int,int> P;

int main(){
	int h , cin >> h;
	int w , cin >> w;
	vector<string> a(h);
	rep(i,h){
		cin>>a[i];
	  }
	vector<bool> row(h.false);
	vector<bool> col(w,false);
	rep(i,h){
		rep(j,w){
			if(a[i][j] =='#'){
			  row[i] =true;
			  col[j] =false;
			}
		  }
	  }
	  rep(i,h){
	  if(row[i]){
		rep(j,w){
		  if(col[j]){
		  cout <<a[i][j];
		}
		}
		cout<<endl;
		}
  }	

}



Compiler output:
a.cc: In function 'int main()':
a.cc:22:21: error: expected initializer before '>>' token
   22 |         int h , cin >> h;
      |                     ^~
a.cc:23:21: error: expected initializer before '>>' token
   23 |         int w , cin >> w;
      |                     ^~
a.cc:28:28: error: expected unqualified-id before 'false'
   28 |         vector<bool> row(h.false);
      |                            ^~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,a,n) for(int i=a;i<=n;i+=2)
using namespace std;

int main(){
  int H,W;
  cin >> H,W;
  
  vector<string> A(H);
  rep(i,0,H) cin >>A[i];
  
  vector<bool> row(H, false);
  vector<bool> col(W, false);
  
  rep(i,0,H){
    rep(j,0,W){
      if(a[i][j]=='#'){
        row[i] = true;
        col[j] = true;
      }
    }
  }

  rep(i,0,H){
    if(row[i]){
      rep(j,0,W){
        if (col[j]) cout << a[i][j];
       }
      cout << endl;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:10: error: 'a' was not declared in this scope
   17 |       if(a[i][j]=='#'){
      |          ^
a.cc:27:29: error: 'a' was not declared in this scope
   27 |         if (col[j]) cout << a[i][j];
      |                             ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,a,n) for(int i=a;i<=n;i+=2)
using namespace std;

int main(){
  int H,W;
  cin >> H,W;
  
  vector<string> A(H);
  rep(i,0,H) cin >>A[i];
  
  vector<bool> row(h, false);
  vector<bool> col(w, false);
  
  rep(i,0,H){
    rep(j,0,W){
      if(a[i][j]=='#'){
        row[i] = true;
        col[j] = true;
      }
    }
  }

  rep(i,0,H){
    if(row[i]){
      rep(j,0,W){
        if (col[j]) cout << a[i][j];
       }
      cout << endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: 'h' was not declared in this scope
   12 |   vector<bool> row(h, false);
      |                    ^
a.cc:13:20: error: 'w' was not declared in this scope
   13 |   vector<bool> col(w, false);
      |                    ^
a.cc:17:10: error: 'a' was not declared in this scope
   17 |       if(a[i][j]=='#'){
      |          ^
a.cc:27:29: error: 'a' was not declared in this scope
   27 |         if (col[j]) cout << a[i][j];
      |                             ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;

int main() {
    int x,y; string board[110];
    bool goodx[110],goody[110];
    cin >> x >> y;
    rep(i,x) cin>>board[x];
    rep(i,x) {
        rep(j,y) {
            if(board[i][j]=="#") {
                goodx[i]=true;
                goody[j]=true; 
            }
        }
    }
    rep(i,x) {
        if(good[x]) {
            rep(j,y) {
                if(goody[j]) {
                    cout<<board[i][j];
                }
            }
            cout<<endl;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |             if(board[i][j]=="#") {
a.cc:19:12: error: 'good' was not declared in this scope; did you mean 'goody'?
   19 |         if(good[x]) {
      |            ^~~~
      |            goody
Language: C++

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

int main() {
  int H,W;
  cin >> H >> W;
  
  vector<vector<char>> vec(H,vector<char>(W,'-'));
  for(int i = 0; i < H; i++) {
    for(int j = 0; j < W; j++) {
      cin >> vec.at(i).at(j);
    }
  }
  
  for(int i = 0; i < vec.size(); i++) {
    for(int j = 0; j < vec.at(0).size(); j++) {
      if(vec.at(i).at(j) == '#') {
        for(int k = 0; k < vec.at(0).size(); k++) {
          cout << vec.at(i).at(k);
        }
       continue; 
      }
   cout << endl;    
    }
  }
 
  for(int i = 0; i < vec.at(0).size(); i++) {
    for(int j = 0; j < vec.size(); j++) {
      if(vec.at(j).at(i) == '#') {
        for(int k = 0; k <vec.size(); k++) {
          cout << vec.at(k).at(i);
        }
      continue;
      }
     cout << endl;
     }
   }
}
  
  for(int i = 0; i < vec.size(); i++) {
    for(int j = 0; j < vec.at(0).size(); j++) {
    cout << vec.at(i).at(j) << endl;
    }
  cout << endl;
  }
}


Compiler output:
a.cc:40:3: error: expected unqualified-id before 'for'
   40 |   for(int i = 0; i < vec.size(); i++) {
      |   ^~~
a.cc:40:18: error: 'i' does not name a type
   40 |   for(int i = 0; i < vec.size(); i++) {
      |                  ^
a.cc:40:34: error: 'i' does not name a type
   40 |   for(int i = 0; i < vec.size(); i++) {
      |                                  ^
a.cc:46:1: error: expected declaration before '}' token
   46 | }
      | ^
Language: C++

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

int main() {
  int H,W;
  cin >> H >> W;
  
  vector<vector<char>> vec(H,vector<char>(W,'-'));
  for(int i = 0; i < H; i++) {
    for(int j = 0; j < W; j++) {
      cin >> vec.at(i).at(j);
    }
  }
  
  for(int i = 0; i < vec.size(); i++) {
    for(int j = 0; j < vec.at(0).size(); j++) {
      if(vec.at(i).at(j) == '#') {
        continue;
      }
     if(vec.at(i).at(vec.at(0).size() - 1)= '.') {
       for( j < vec.at(0).size(); j++;) {
        vec.at(i).at(j) = '';
       } 
     }
    }
  }
 
  for(int i = 0; i < vec.at(0).size(); i++) {
    for(int j = 0; j < vec.size(); j++) {
      if(vec.at(j).at(i) == '#') {
        continue;
      }
      if(vec.at(vec.size() - 1).at(i)= '.') {
        for( j < vec.size(); j++;) {
        vec.at(j).at(i) = '';
       } 
     }
   }
  }
  
  for(int i = 0; i < vec.size(); i++) {
    for(int j = 0; j < vec.at(0).size(); j++) {
    cout << vec.at(i).at(j) << endl;
    }
  cout << endl;
  }
}


Compiler output:
a.cc:22:27: error: empty character constant
   22 |         vec.at(i).at(j) = '';
      |                           ^~
a.cc:35:27: error: empty character constant
   35 |         vec.at(j).at(i) = '';
      |                           ^~
Language: C++

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

int main() {
  int H,W;
  cin >> H >> W;
  
  vector<vector<char>> vec(H,vector<char>(W,'-'));
  for(int i = 0; i < H; i++) {
    for(int j = 0; j < W; j++) {
      cin >> vec.at(i).at(j);
    }
  }
  
  for(int i = 0; i < vec.size(); i++) {
    for(int j = 0; j < vec.at(0).size(); j++) {
      if(vec.at(i).at(j) == '#') {
        continue;
      }
     if(vec.at(i).at(vec.at(0).size() - 1)= '.') {
       for( j < vec.at(0).size(); j++;) {
        vec.at(i).at(j) = /null;
       } 
     }
    }
  }
 
  for(int i = 0; i < vec.at(0).size(); i++) {
    for(int j = 0; j < vec.size(); j++) {
      if(vec.at(j).at(i) == '#') {
        continue;
      }
      if(vec.at(vec.size() - 1).at(i)= '.') {
        for( j < vec.size(); j++;) {
        vec.at(j).at(i) = /null;
       } 
     }
   }
  }
  
  for(int i = 0; i < vec.size(); i++) {
    for(int j = 0; j < vec.at(0).size(); j++) {
    cout << vec.at(i).at(j) << endl;
    }
  cout << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:27: error: expected primary-expression before '/' token
   22 |         vec.at(i).at(j) = /null;
      |                           ^
a.cc:22:28: error: 'null' was not declared in this scope
   22 |         vec.at(i).at(j) = /null;
      |                            ^~~~
a.cc:35:27: error: expected primary-expression before '/' token
   35 |         vec.at(j).at(i) = /null;
      |                           ^
a.cc:35:28: error: 'null' was not declared in this scope
   35 |         vec.at(j).at(i) = /null;
      |                            ^~~~
Language: C++

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

int main() {
  int H,W;
  cin >> H >> W;
  
  vector<vector<char>> vec(H,vector<char>(W,'-'));
  for(int i = 0; i < H; i++) {
    for(int j = 0; j < W; j++) {
      cin >> vec.at(i).at(j);
    }
  }
  
  for(int i = 0; i < vec.size(); i++) {
    for(int j = 0; j < vec.at(0).size(); j++) {
      if(vec.at(i).at(j) == '#') {
        continue;
      }
     if(vec.at(i).at(vec.at(0).size() - 1)= '.') {
       for( j < vec.at(0).size(); j++;) {
        vec.at(i).at(j) = null;
       } 
     }
    }
  }
 
  for(int i = 0; i < vec.at(0).size(); i++) {
    for(int j = 0; j < vec.size(); j++) {
      if(vec.at(j).at(i) == '#') {
        continue;
      }
      if(vec.at(vec.size() - 1).at(i)= '.') {
        for( j < vec.size(); j++;) {
          vec.at(j).at(i) = null;
       } 
     }
   }
  }
  
  for(int i = 0; i < vec.size(); i++) {
    for(int j = 0; j < vec.at(0).size(); j++) {
    cout << vec.at(i).at(j) << endl;
    }
  cout << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:27: error: 'null' was not declared in this scope
   22 |         vec.at(i).at(j) = null;
      |                           ^~~~
a.cc:35:29: error: 'null' was not declared in this scope
   35 |           vec.at(j).at(i) = null;
      |                             ^~~~
Language: C++

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

int main() {
  int m, n;
  cin >> m >> n;
  map<int, string> a;
  for(int i = 0; i < m; i++)
    cin >> a[i];
  for(int i = 0; i < m; i++){
    bool b = 1;
    for(int j = 0; j < n; j++){
      if(a[i].at(j) == '#'){
        b = 0;
        break;
      }
    }
    if(b)
      a.erase(i);
  }
  for(int i = 0; i < n; i++){
    bool b = 1;
    for(int j = 0; j < m; j++){
      if(a[j].at(i) == '#'){
        b = 0;
        break;
      }
    }
    if(b){
      for(int i = 0; i < m; i++)
        a[i].erase(a[i].begin(), j);
    }
  }
  for(int i = 0; i < m; i++){
    cout << a[i] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:34: error: 'j' was not declared in this scope
   31 |         a[i].erase(a[i].begin(), j);
      |                                  ^
a.cc:36:2: error: expected '}' at end of input
   36 | }
      |  ^
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;
  cin >> H >> W;
  
  vector<vector<char>> vec(H,vector<char>(W,'-'));
  for(int i = 0; i < H; i++) {
    for(int j = 0; j < W; j++) {
      cin >> vec.at(i).at(j);
    }
  }
  
  for(int i = 0; i < vec.size(); i++) {
    for(int j = 0; j < vec.at(0).size(); j++) {
      if(vec.at(i).at(j) == '#') {
        continue;
      }
     if(vec.at(i).at(vec.at(0).size() - 1)= '.') {
       for( j < vec.at(0).size(); j++;) {
        vec.pop_back(vec.at(i).at(j));
       } 
     }
    }
  }
 
  for(int i = 0; i < vec.at(0).size(); i++) {
    for(int j = 0; j < vec.size(); j++) {
      if(vec.at(j).at(i) == '#') {
        continue;
      }
      if(vec.at(vec.size() - 1).at(i)= '.') {
        for( j < vec.size(); j++;) {
        vec.pop_back(vec.at(j).at(i));
       } 
     }
   }
  }
  
  for(int i = 0; i < vec.size(); i++) {
    for(int j = 0; j < vec.at(0).size(); j++) {
    cout << vec.at(i).at(j) << endl;
    }
  cout << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:21: error: no matching function for call to 'std::vector<std::vector<char> >::pop_back(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
   22 |         vec.pop_back(vec.at(i).at(j));
      |         ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1324:7: note: candidate: 'void std::vector<_Tp, _Alloc>::pop_back() [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >]'
 1324 |       pop_back() _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1324:7: note:   candidate expects 0 arguments, 1 provided
a.cc:35:21: error: no matching function for call to 'std::vector<std::vector<char> >::pop_back(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
   35 |         vec.pop_back(vec.at(j).at(i));
      |         ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1324:7: note: candidate: 'void std::vector<_Tp, _Alloc>::pop_back() [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >]'
 1324 |       pop_back() _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1324:7: note:   candidate expects 0 arguments, 1 provided
Language: C++

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

int main() {
  int H,W;
  cin >> H >> W;
  
  vector<vector<char>> vec(H,vector<char>(W,'-'));
  for(int i = 0; i < H; i++) {
    for(int j = 0; j < W; j++) {
      cin >> vec.at(i).at(j);
    }
  }
  
  for(int i = 0; i < vec.size(); i++) {
    for(int j = 0; j < vec.at(0).size(); j++) {
      if(vec.at(i).at(j) == '#') {
        continue;
      }
     if(vec.at(i).at(vec.at(0).size() - 1)= '.') {
       for( j < vec.at(0).size(); j++;) {
        pop_back(vec.at(i).at(j));
       } 
     }
    }
  }
 
  for(int i = 0; i < vec.at(0).size(); i++) {
    for(int j = 0; j < vec.size(); j++) {
      if(vec.at(j).at(i) == '#') {
        continue;
      }
      if(vec.at(vec.size() - 1).at(i)= '.') {
        for( j < vec.size(); j++;) {
        pop_back(vec.at(j).at(i));
       } 
     }
   }
  }
  
  for(int i = 0; i < vec.size(); i++) {
    for(int j = 0; j < vec.at(0).size(); j++) {
    cout << vec.at(i).at(j) << endl;
    }
  cout << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:9: error: 'pop_back' was not declared in this scope
   22 |         pop_back(vec.at(i).at(j));
      |         ^~~~~~~~
a.cc:35:9: error: 'pop_back' was not declared in this scope
   35 |         pop_back(vec.at(j).at(i));
      |         ^~~~~~~~
Language: C++

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

int main() {
  int H,W;
  cin >> H >> W;
  
  vector<vector<char>> vec(H,vector<char>(W,'-'));
  for(int i = 0; i < H; i++) {
    for(int j = 0; j < W; j++) {
      cin >> vec.at(i).at(j);
    }
  }
  
  for(int i = 0; i < vec.size(); i++) {
    for(int j = 0; j < vec.at(0).size(); j++)
    if(vec.at(i).at(j) == '#') {
      continue;
    }
    if(vec.at(i).at(vec.at(0).size() - 1)= '.') {
   for( j < vec.at(0).size(); j++;) {
      pop_back(vec.at(i).at(j));
    } 
  }
  
 for(int i = 0; i < vec.at(0).size(); i++) {
    for(int j = 0; j < vec.size(); j++)
    if(vec.at(j).at(i) == '#') {
      continue;
    }
    if(vec.at(vec.size() - 1).at(i)= '.') {
   for( j < vec.size(); j++;) {
      pop_back(vec.at(j).at(i));
    } 
  }
  
  for(int i = 0; i < vec.size(); i++) {
    for(int j = 0; j < vec.at(0).size(); j++) {
    cout << vec.at(i).at(j) << endl;
    }
  cout << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: 'j' was not declared in this scope
   21 |    for( j < vec.at(0).size(); j++;) {
      |         ^
a.cc:22:7: error: 'pop_back' was not declared in this scope
   22 |       pop_back(vec.at(i).at(j));
      |       ^~~~~~~~
a.cc:32:9: error: 'j' was not declared in this scope
   32 |    for( j < vec.size(); j++;) {
      |         ^
a.cc:33:7: error: 'pop_back' was not declared in this scope
   33 |       pop_back(vec.at(j).at(i));
      |       ^~~~~~~~
a.cc:43:2: error: expected '}' at end of input
   43 | }
      |  ^
a.cc:15:39: note: to match this '{'
   15 |   for(int i = 0; i < vec.size(); i++) {
      |                                       ^
a.cc:43:2: error: expected '}' at end of input
   43 | }
      |  ^
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;
  cin >> H >> W;
  
  vector<vector<char>> vec(H,vector<char>(W,'-'));
  for(int i = 0; i < H; i++) {
    for(int j = 0; j < W; j++) {
      cin >> vec.at(i).at(j);
    }
  }
  
  for(int i = 0; i < vec.size(); i++) {
    for(int j = 0; j < vec.at(0).size(); j++)
    if(vec.at(i).at(j) == '#') {
      continue;
    }
    if(vec.at(i).at(vec.at(0).size() - 1)= '.') {
   for( j < vec.at(0).size(); j++) {
      pop_back(vec.at(i).at(j));
    } 
  }
  
 for(int i = 0; i < vec.at(0).size(); i++) {
    for(int j = 0; j < vec.size(); j++)
    if(vec.at(j).at(i) == '#') {
      continue;
    }
    if(vec.at(vec.size() - 1).at(i)= '.') {
   for( j < vec.size(); j++) {
      pop_back(vec.at(j).at(i));
    } 
  }
  
  for(int i = 0; i < vec.size(); i++) {
    for(int j = 0; j < vec.at(0).size(); j++) {
    cout << vec.at(i).at(j) << endl;
    }
  cout << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: 'j' was not declared in this scope
   21 |    for( j < vec.at(0).size(); j++) {
      |         ^
a.cc:21:34: error: expected ';' before ')' token
   21 |    for( j < vec.at(0).size(); j++) {
      |                                  ^
      |                                  ;
a.cc:22:7: error: 'pop_back' was not declared in this scope
   22 |       pop_back(vec.at(i).at(j));
      |       ^~~~~~~~
a.cc:32:9: error: 'j' was not declared in this scope
   32 |    for( j < vec.size(); j++) {
      |         ^
a.cc:32:28: error: expected ';' before ')' token
   32 |    for( j < vec.size(); j++) {
      |                            ^
      |                            ;
a.cc:33:7: error: 'pop_back' was not declared in this scope
   33 |       pop_back(vec.at(j).at(i));
      |       ^~~~~~~~
a.cc:43:2: error: expected '}' at end of input
   43 | }
      |  ^
a.cc:15:39: note: to match this '{'
   15 |   for(int i = 0; i < vec.size(); i++) {
      |                                       ^
a.cc:43:2: error: expected '}' at end of input
   43 | }
      |  ^
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;
  cin >>H>>W;
  vector<vector<char>> table(H,vector<char>(W));
  for (int i=0;i<H;i++){
    for (int j=0;j<W;j++){
      cin>>table.at(i).at(j);
    }
  }
  for (int i=0;i<H;i++){
    int count=0;
    for (int j=0;j<W;j++){
      if (table.(i).a(j)=='_'){
        count++;
      }
    }
    if (count!=W){
      for (int j=0;j<W;j++){
        int count2=0;
        for (int x=0;x<H;x++){
          if(table.at(x).at(j)=='_'){
            count2++;
          }
        }
        if (count2!=H){
          cout << table.at(i).at(j);
        }
      }
      cout<<endl;
    }
  }
}

Compiler output:
a.cc:1:25: warning: extra tokens at end of #include directive
    1 | #include <bits/stdc++.h>;
      |                         ^
a.cc: In function 'int main()':
a.cc:16:17: error: expected unqualified-id before '(' token
   16 |       if (table.(i).a(j)=='_'){
      |                 ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
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;
		}
	}
}
#include <iostream>
#include <string>
#include <vector>
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:43:5: error: redefinition of 'int main()'
   43 | int main() {
      |     ^~~~
a.cc:6:5: note: 'int main()' previously defined here
    6 | int main() {
      |     ^~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
  int N,M;
  cin >> N >> M;
  char data[N][M]={};
  for(int i=0;i<N;i++){
    for(int j=0;j<M;j++){
		cin >> data[i][j];
    }
  }
  int count=0;
  int H=N;
  int W=M;
  for(int i=0;i<N;i++){
    for(int j=0;j<M;j++){
		if(data[i][j]=='.'){
          count++;
        }
    }
   	if(count==M){
       for(int k=0;k<M;k++){
		data[i][k]=' ';
   		}
      H--;
    }
   count=0;      
  }
  for(int i=0;i<M;i++){
    for(int j=0;j<N;j++){
		if(data[i][j]=='.'){
          count++;
        }
    }
    if(count==N){
      for(int k=0;k<N;k++){
	  	data[j][k]=' ';
      }
      W--;
    }
    count=0;   
  }
  for(int i=0;i<N;i++){
    for(int j=0;j<M;j++){
		if(data[i][j]=='.'||data[i][j]=='#'){
          cout << data[i][j];
          count++;
        }     
      if(count%W==0)
      {
		cout << endl;
      }
    }
  }
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:22: error: 'j' was not declared in this scope
   38 |                 data[j][k]=' ';
      |                      ^
Language: C++

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

int main(){
  int H, W;
  cin >> H >> W;
  
  vector<vector<char>> a(H, vector<char>(W));
  vector<char> b(W, '.');
  vector<char> c(W, ' ');
  
  for (int i = 0; i < H; i++){
    for (int j = 0; j < M; j++){
      cin >> a.at(i).at(j);
    }
  }
  for(int i = 0; i < H; i++){
    if (a.at(i) == b){
      for (int j = i; j < H; j++){
        a.at(j) = a.at(j + 1);
        a.at(H) = c;
      }
    }


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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int H, W;
  cin >> H >> W;
  
  vector<vector<char>> data(H, vector<char>(W));
  for (i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      cin >> data.at(i).at(j);
    }
  }
  
  //H
  vector<bool> heightWhite(H, false);
  for (i = 0; i < W; i++) {
    bool isAllWhite = true;
    for (int j = 0; j < H; j++) {
      if (data.at(j).at(i) == '#') {
        isAllWhite = false;
        break;
      }
    }
    
    if (isAllWhite)
      heightWhite.at(i) = isAllWhite;
  }
  
  //W
  vector<bool> widthWhite(H, false);
  for (i = 0; i < H; i++) {
    bool isAllWhite = true;
    for (int j = 0; j < W; j++) {
      if (data.at(i).at(j) == '#') {
        isAllWhite = false;
        break;
      }
    }
    
    if (isAllWhite)
      widthWhite.at(i) = isAllWhite;
  }
  
  for (i = 0; i < H; i++) {
    if(!heightWhite.at(i)) {
      for (int j = 0; j < W; j++) {
        if (!widthWhite.at(j))
          cout << data.at(i).at(j);
      }
    }
    cout << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:8: error: 'i' was not declared in this scope
    9 |   for (i = 0; i < H; i++) {
      |        ^
a.cc:17:8: error: 'i' was not declared in this scope
   17 |   for (i = 0; i < W; i++) {
      |        ^
a.cc:32:8: error: 'i' was not declared in this scope
   32 |   for (i = 0; i < H; i++) {
      |        ^
a.cc:45:8: error: 'i' was not declared in this scope
   45 |   for (i = 0; i < H; i++) {
      |        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
int main(){
  int h,w;
  cin>>h>>w;
  vector<vector<int>> a(h,vector<int>(w));
  rep(i,h){
    rep(j,w){
      cin>>a.at(i)(j);
    }
  }
  vector<bool>f(h,false);
  vector<bool>flag(w,false);  
   rep(i,h){
    rep(j,w){
      if(a.at(i)(j)=='#')f[i]=true;
    }
  }
  rep(j,w){
    rep(i,h){
      if(a.at(i)(j)=='#')flag[j]=true;
    }
  }
  rep(i,h){
    if(!f[i]) continue;
    rep(j,w){
      if(flag[j])cout<<a.at(i)(j);
    }
    cout<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:19: error: no match for call to '(__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type {aka std::vector<int>}) (int&)'
   18 |       cin>>a.at(i)(j);
      |            ~~~~~~~^~~
a.cc:25:17: error: no match for call to '(__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type {aka std::vector<int>}) (int&)'
   25 |       if(a.at(i)(j)=='#')f[i]=true;
      |          ~~~~~~~^~~
a.cc:30:17: error: no match for call to '(__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type {aka std::vector<int>}) (int&)'
   30 |       if(a.at(i)(j)=='#')flag[j]=true;
      |          ~~~~~~~^~~
a.cc:36:31: error: no match for call to '(__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type {aka std::vector<int>}) (int&)'
   36 |       if(flag[j])cout<<a.at(i)(j);
      |                        ~~~~~~~^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
int main(){
  int h,w;
  cin>>h>>w;
  vector<vector<int>> a(h,vector<int>(w));
  rep(i,h){
    rep(j,w){
      cin>>a[i][j];
    }
  }
  vector<bool>f(h,false);
  vector<bool>flag(w,false);  
   rep(i,h){
    rep(j,w){
      if(a[i][j]=='#')f[i]=true;
    }
  }
  rep(i,w){
    rep(j,h){
      if(a[j][i]=='#')flag[i]=true;
    }
  }
  rep(i,h){
    if(!f[i]) continue;
    rep(j,w){
      if(flag[j])cout<<a[i][j];
    }
    cout<<endl;
  }
}
}

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

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
int main(){
  int h,w;
  cin>>h>>w;
  vector<vector<int>> a(h,vector<int>(w));
  rep(i,h){
    rep(j,w){
      cin>>a[i][j];
    }
  }
  vector<bool>f(h,false);
  vector<bool>flag(w,false);  
   rep(i,h){
    rep(j,w){
      if(a[i][j]=='#')f[i]=true;
    }
  }
  rep(i,w){
    rep(j,h){
      if(a[j][i]=='#')flag[i]=true;
    }
  }
  rep(i,h){
    if(!f[i]) continue;
    rep(j,w){
      if(flag[j])cout<<a[i][j]<<
    }
    <<endl;
  }
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:5: error: expected primary-expression before '}' token
   37 |     }
      |     ^
a.cc:38:5: error: expected primary-expression before '<<' token
   38 |     <<endl;
      |     ^~
a.cc: At global scope:
a.cc:41:1: error: expected declaration before '}' token
   41 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
int main(){
  int h,w;
  cin>>h>>w;
  vector<vector<int>> a(h,vector<int>(w));
  rep(i,h){
    rep(j,w){
      cin>>a[i][j];
    }
  }
  vector<bool>f(h,false);
  vector<bool>flag(w,false);  
   rep(i,h){
    rep(j,w){
      if(a[i][j]=='#')f[i]=true;
    }
  }
  rep(i,w){
    rep(j,h){
      if(a[j][i]=='#')flag[i]=true;
    }
  }
  rep(i,h){
    if(!f[i]) continue;
    rep(j,w){
      if(flag[j])cout<<a[i][j];
    }
    <<endl;
  }
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:5: error: expected primary-expression before '<<' token
   38 |     <<endl;
      |     ^~
a.cc: At global scope:
a.cc:41:1: error: expected declaration before '}' token
   41 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
int main(){
  int h,w;
  cin>>h>>w;
  vector<vector<int>> a(h,vector<int>(w));
  rep(i,h){
    rep(j,w){
      cin>>a[i][j];
    }
  }
  rep(i,h){
    int cnt=0;
    bool f=false;
    rep(j,w){
      if(a[i][j]=='.')cnt++;
      if(cnt==w)f=true;
    }
    if(f){
      rep(j,w)a[i].erase(a[i].begin()+j);
    }
  }
  rep(i,w){
    int cnt=0;
    bool f=false;
    rep(j,h){
      if(a[j][i]=='.')cnt++;
      if(cnt==h)f=true;
    }
    if(f){
      rep(j,h)a[j][i].erase(a[j][i].begin());
    }
  }
   rep(i,h){
    rep(j,w){
      cout<<a[i][j]<<endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:23: error: request for member 'erase' in '(& a.std::vector<std::vector<int> >::operator[](((std::vector<std::vector<int> >::size_type)j)))->std::vector<int>::operator[](((std::vector<int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   40 |       rep(j,h)a[j][i].erase(a[j][i].begin());
      |                       ^~~~~
a.cc:40:37: error: request for member 'begin' in '(& a.std::vector<std::vector<int> >::operator[](((std::vector<std::vector<int> >::size_type)j)))->std::vector<int>::operator[](((std::vector<int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   40 |       rep(j,h)a[j][i].erase(a[j][i].begin());
      |                                     ^~~~~
Language: C

#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0;i < (int)(n);i++)

int main(){
int H,W,h,w;
  h=0;
  w=0;
  cin >> H >> W;
    vector<vector<char>> data(H, vector<char>(W))
  rep (i, H){
  rep(j, W)
  cin >> data.at(i).at(j);
  }
    rep (i, H){
  rep(j, W){
  cout << data.at(i).at(j);
  }
  }
}


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

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

#define REP(i,n) for (int i=0; i<(n); i++)
#define ll long long
const long long INF = 1LL<<60;
const long long mod = 1e9+7;

int main() {
  int H,W;
  cin >> H >> W;
  vector<vector<char>> a(H,vector<char>(W));
  REP(i,H){
    REP(j,W){
      cin >> a.at(i).at(j);
    }
  }
  
  bool row[H];
  bool column[W];
  REP(i,H){
    row[i] = true;
    REP(j,W){
      if (a.at(i).at(j) == '#') row[i] = false;
    }
  }
  
  REP(i,W){
    column[i] = true;
    REP(j,H){
      if (a.at(i).at(j) == '#') column[i] = false;
    }
  }
  
  REP(i,H){
    if (row[i]) continue;
    REP(j,W){
      if (!cokumn[j]) cout << a.at(i).at(j);
    }
    cout << endl;
  }
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:12: error: 'cokumn' was not declared in this scope; did you mean 'column'?
   38 |       if (!cokumn[j]) cout << a.at(i).at(j);
      |            ^~~~~~
      |            column
Language: C++

 
int main() {
  int H,W;
  cin >> H >> W;
  vector<vector<char>> data(H, vector<char>(W));
  
  for(int i = 0;i<H;i++){
    for(int j= 0;j<W;j++){
      cin >> data.at(i).at(j);
    }
  }
  
  for(int i = 0;i< H;i++){
    int c =0;
   for(int j = 0;j<W;j++){//各行毎に.の数を計算し、すべて.でなければ出力していく
     if(data.at(i).at(j) == '.') c++;
   }
    if(c < W){
      for(int j = 0;j<W;j++){
        cout << data.at(i).at(j);
        if(j== W-1) cout <<endl;
      }
    }
  }
          
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'cin' was not declared in this scope
    4 |   cin >> H >> W;
      |   ^~~
a.cc:5:3: error: 'vector' was not declared in this scope
    5 |   vector<vector<char>> data(H, vector<char>(W));
      |   ^~~~~~
a.cc:5:17: error: expected primary-expression before 'char'
    5 |   vector<vector<char>> data(H, vector<char>(W));
      |                 ^~~~
a.cc:9:14: error: 'data' was not declared in this scope
    9 |       cin >> data.at(i).at(j);
      |              ^~~~
a.cc:16:9: error: 'data' was not declared in this scope
   16 |      if(data.at(i).at(j) == '.') c++;
      |         ^~~~
a.cc:20:9: error: 'cout' was not declared in this scope
   20 |         cout << data.at(i).at(j);
      |         ^~~~
a.cc:20:17: error: 'data' was not declared in this scope
   20 |         cout << data.at(i).at(j);
      |                 ^~~~
a.cc:21:28: error: 'endl' was not declared in this scope
   21 |         if(j== W-1) cout <<endl;
      |                            ^~~~
Language: Java

7 6
......
....#.
.#....
..#...
..#...
......
.#..#.

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
7 6
^
Main.java:3: error: illegal character: '#'
....#.
    ^
Main.java:4: error: illegal character: '#'
.#....
 ^
Main.java:5: error: illegal '.'
..#...
 ^
Main.java:5: error: illegal character: '#'
..#...
  ^
Main.java:6: error: illegal '.'
..#...
 ^
Main.java:6: error: illegal character: '#'
..#...
  ^
Main.java:8: error: illegal character: '#'
.#..#.
 ^
Main.java:8: error: illegal '.'
.#..#.
   ^
Main.java:8: error: illegal character: '#'
.#..#.
    ^
10 errors
Language: C++

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

int main() {
  int h, w;
  cin >> h >> w;
  
  vector<string> a(h);
  for (int i = 0; i < h; i++) {
    cin >> a.at(i);
  }
  
  vector<bool> row(h, false);
  vector<bool> col(w, false);
  for (int i = 0; i < h; i++) {
    for (int j = 0; h < w; j++) {
      if (a.at(i).at(j) == '#') {
        row.at(i) = true;
        col.at(i) = true;
      }
    }
  }
  
  for (int i = 0; i < h; i++) {
    if (row.at(i)) {
      for (int j = 0; j < w; j++) {
        if (col.at(j)) {
          cout << a.at(i).at(j);
        }
      }
      cout << endl;
    }
}

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

#include<bits/stdc++.h>
#define rep(i,n) for(int (i) = 0;(i) < (n);(i)++)
#define SORT(c) sort((c).begin(),(c).end())
#define INF 1e9

using namespace std;

typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef vector<bool> VB;

int main(void){
  int H,W; cin>>H>>W;
  vector<vector<char>> VVC(H,vector<char>(W,0));
  VB tatecheck(H,false);
  VB yokocheck(W,false);

  rep(i ,H){
    rep(t ,W){
      cin>>VVC[i][t];
      if(VVC[i][t] == '#'){
        tatecheck[i] = true;
        yokocheck[t] = true;
      }
    }
  }

  rep(p,H ){
    rep(q ,W){
      if(tatecheck[p] && yokocheck[q]){
        cout<<VVC[p][q];
      }
    }
    if(tatecheck[p])cout<<endl;
  }
}


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

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

int main(){
	int h,w;cin>>h>>w;
  	vector<string>s(h);
   	for(auto&& u:s)cin>>u;
  	for(int i=h-1;i>=0;i--){
    	if(s[i]==string(w,'.'))s.erase(begin(s)+i);
    }
    int h0=s.size();
  	for(int j=w-1;j>=0;i--){
		bool flg=true;
    	for(int i=0;i<h0;i++){
        if(s[i][j]!='.')flg=false;
        }
    	if(flg){
        for(int i=0;i<h0;i++){
        s[i].erase(j);
        }
    }
      for(auto&& u:s)cout<<u<<endl;     
      
    }
           
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:28: error: 'i' was not declared in this scope
   12 |         for(int j=w-1;j>=0;i--){
      |                            ^
Language: C++

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

int main(){
	int h,w;cin>>h>>w;
  	vector<string>s(h);
   	for(auto&& u:s)cin>>u;
  	for(int i=h-1;i>=0;i--){
    	if(s[i]==string(w,'.'))erase(s[i]);
    }
    int h0=s.size();
  	for(int i=h0-1;i>=0;i--){
		bool flg=true:
    	for(int j=0;j<h0;j++){
        if(s[i][j]!='.')flg=false;
        }
    	if(flg){
        for(int j=0;j<h0;j++){
        erase(s[j][i]);
        }
    }
      for(auto&& u:s)cout<<u<<endl;     
      
    }
           
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:32: error: 'erase' was not declared in this scope
    9 |         if(s[i]==string(w,'.'))erase(s[i]);
      |                                ^~~~~
a.cc:13:30: error: expected ',' or ';' before ':' token
   13 |                 bool flg=true:
      |                              ^
a.cc:14:21: error: 'j' was not declared in this scope
   14 |         for(int j=0;j<h0;j++){
      |                     ^
a.cc:19:9: error: 'erase' was not declared in this scope
   19 |         erase(s[j][i]);
      |         ^~~~~
Language: C++

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

int main(){
	int h,w;cin>>h>>w;
  	vector<string>s(h);
   	for(auto&& u:s)cin>>u;
  	for(int i=h-1;i>=0;i--){
    	if(s[i]==string(w,'.')erase(s[i]);
    }
    int h0=s.size();
  	for(int i=w0-1;i>=0;i--){
		bool flg=true:
    	for(int j=0;j<h0;j++){
        if(s[i][j]!='.')flg=false;
        }
    	if(flg){
        for(int j=0;j<h0;j++){
        erase(s[j][i]);
        }
    }
      for(auto&& u:s)cout<<u<<endl;     
      
    }
           
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:31: error: expected ';' before 'erase'
    9 |         if(s[i]==string(w,'.')erase(s[i]);
      |                               ^~~~~
      |                               ;
a.cc:9:16: warning: ignoring return value of 'bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]', declared with attribute 'nodiscard' [-Wunused-result]
    9 |         if(s[i]==string(w,'.')erase(s[i]);
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:3755:5: note: declared here
 3755 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
a.cc:10:5: error: expected primary-expression before '}' token
   10 |     }
      |     ^
a.cc:9:43: error: expected ')' before '}' token
    9 |         if(s[i]==string(w,'.')erase(s[i]);
      |           ~                               ^
      |                                           )
   10 |     }
      |     ~                                      
a.cc:10:5: error: expected primary-expression before '}' token
   10 |     }
      |     ^
a.cc:12:19: error: 'w0' was not declared in this scope; did you mean 'h0'?
   12 |         for(int i=w0-1;i>=0;i--){
      |                   ^~
      |                   h0
a.cc:13:30: error: expected ',' or ';' before ':' token
   13 |                 bool flg=true:
      |                              ^
a.cc:14:21: error: 'j' was not declared in this scope
   14 |         for(int j=0;j<h0;j++){
      |                     ^
a.cc:19:9: error: 'erase' was not declared in this scope
   19 |         erase(s[j][i]);
      |         ^~~~~
Language: C++

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

int main(){
	int h,w;cin>>h>>w;
  	vector<string>s(h);
   	for(auto&& u:s)cin>>u;
  	for(int i=h-1;i>=0;i--){
    	if(s[i]==string(w,'.')erase(s[i]);
    }
    int h0=s.size();
  	for(int i=w0-1;i>=0;i--){
		bool flg=true:
    	for(int j=0;j<h0;j++){
        if(s[i][j]!='.')flg=false;
        }
    	if(flg){
        for(int j=0;j<h0;j++){
        erase(s[j][i]);
        }
    }
      for(auto&& u:s)cout<<u<<endl;     
      
    }
           
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:17: error: 'cin' was not declared in this scope
    5 |         int h,w;cin>>h>>w;
      |                 ^~~
a.cc:6:9: error: 'vector' was not declared in this scope
    6 |         vector<string>s(h);
      |         ^~~~~~
a.cc:6:16: error: 'string' was not declared in this scope
    6 |         vector<string>s(h);
      |                ^~~~~~
a.cc:6:23: error: 's' was not declared in this scope
    6 |         vector<string>s(h);
      |                       ^
a.cc:10:5: error: expected primary-expression before '}' token
   10 |     }
      |     ^
a.cc:9:43: error: expected ')' before '}' token
    9 |         if(s[i]==string(w,'.')erase(s[i]);
      |           ~                               ^
      |                                           )
   10 |     }
      |     ~                                      
a.cc:10:5: error: expected primary-expression before '}' token
   10 |     }
      |     ^
a.cc:12:19: error: 'w0' was not declared in this scope; did you mean 'h0'?
   12 |         for(int i=w0-1;i>=0;i--){
      |                   ^~
      |                   h0
a.cc:13:30: error: expected ',' or ';' before ':' token
   13 |                 bool flg=true:
      |                              ^
a.cc:14:21: error: 'j' was not declared in this scope
   14 |         for(int j=0;j<h0;j++){
      |                     ^
a.cc:19:9: error: 'erase' was not declared in this scope
   19 |         erase(s[j][i]);
      |         ^~~~~
a.cc:22:22: error: 'cout' was not declared in this scope
   22 |       for(auto&& u:s)cout<<u<<endl;
      |                      ^~~~
a.cc:22:31: error: 'endl' was not declared in this scope
   22 |       for(auto&& u:s)cout<<u<<endl;
      |                               ^~~~
Language: C++

#include<iostream>
using namespace std;

int main(){
  int h,w; cin>>h>>w;
  char a[h][w];
  int i,j;
  bool hf[h]={1},wh[w]={1};
  
  for(i=0;i<h;i++){
    for(j=0;j<w;j++){
      cin>>a[i][j];
    }
  }
  
  for(i=0;i<h;i++){
    for(j=0;j<w;j++){
      if(a[i][j]=='#'){
        hf[i]=0;
        break;
      }
    }
  }
  
  for(i=0;i<w;i++){
    for(j=0;j<h;j++){
      if(a[j][i]=='#'){
        wf[i]=0;
        break;
      }
    }
  }

  for(i=0;i<h;i++){
    if(hf[i]==0){
      for(j=0;j<w;j++){
        if(wf[j]=0){
        cout<<a[i][j];
        }
      }
      endl;
    }
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:9: error: 'wf' was not declared in this scope; did you mean 'wh'?
   28 |         wf[i]=0;
      |         ^~
      |         wh
a.cc:37:12: error: 'wf' was not declared in this scope; did you mean 'wh'?
   37 |         if(wf[j]=0){
      |            ^~
      |            wh
a.cc:41:11: error: statement cannot resolve address of overloaded function
   41 |       endl;
      |           ^
Language: C++

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

int main(){
  int h, w;
  cin >> h >> w;
  vector<vector<char>> table(h, vector<char>(w));
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      cin >> table[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 (table[i][j] == '#') {
				row[i] = true;
				col[j] = true;
			}
		}
	}
  if(row[i]){
    for(int i=0;i<h;i++){
      if(col[j]){
        for(int j=0;j<w;j++){
          cout << table[i][j];
        }
      }
      cout << endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:10: error: 'i' was not declared in this scope
   23 |   if(row[i]){
      |          ^
a.cc:25:14: error: 'j' was not declared in this scope
   25 |       if(col[j]){
      |              ^
Language: C++

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

int main(){
  int h, w;
  cin >> h >> w;
  vector<vector<char>> table(h, vector<char>(w));
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      cin >> table.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 (a[i][j] == '#') {
				row[i] = true;
				col[j] = true;
			}
		}
	}
  if(row[i]){
    for(int i=0;i<h;i++){
      if(col[j]){
        for(int j=0;j<w;j++){
          cout << table[i][j];
        }
      }
      cout << endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:29: error: 'a' was not declared in this scope
   17 |                         if (a[i][j] == '#') {
      |                             ^
a.cc:23:10: error: 'i' was not declared in this scope
   23 |   if(row[i]){
      |          ^
a.cc:25:14: error: 'j' was not declared in this scope
   25 |       if(col[j]){
      |              ^
Language: C++

#include<bits/stdc++.h>
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
using namespace std;

int main(void) {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int H, W;
	cin >> H >> W;
	vector<string> a(H);
	vector<string> n;
	rep(i, H) cin >> a[i];
	rep(i, H) {
		rep(j, W) {
			if (a[i][j] == '#') {
				n.pb(a[i]);
				break;
			}
		}
	}

	char ans[100][100];
	int w = 0;
	rep(i, W) {
		bool flag = false;
		rep(j, n.size()) {
			if (flag) ans[j][w] = n[j][i];
			if (n[j][i] == '#' && !flag) {
				flag = true;
				j = 0;
				ans[j][w] = n[j][i];
			}
		}
		w++;
		if (!flag)w--;
	}
	ll i = 0;
	ll j = 0;
	for (i; i < H; ++i) {
		j = 0;
		bool flag = false;
		if (ans[i][j] != '#' && ans[i][j] != '.') break;
		for (j; j < W; ++j) {
			if (ans[i][j] == '#' || ans[i][j] == '.') cout << ans[i][j];
			else {
				flag = true;
				cout << endl;
				break;
			}
		}
		if(!flag) cout << endl;
	}

}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:35: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'pb'
   17 |                                 n.pb(a[i]);
      |                                   ^~
Language: C++

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

int main() {
  int H,W;
  cin >> H >> W;
  vector<vector<int>> a(H,vector<int>(W));
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      cin >> a.at(H).at(W);
    }
  }
  int x=1;
  while(x!=0){
    x=0;
    for(int i=0;i<a.size();i++){
      int s=0;
      for(int j=0;j<W;j++){
        if(a[i][j]=='#')s+=1;
      }
      if(s==0){
        a.erase(a.begin() + i);
        x+=1;
      }
    }
  }
  int x=1;
  while(x!=0){
    x=0;
    for(int i=0;i<a.front().size();i++){
      int s=0;
      for(int j=0;j<W;j++){
        if(a[j][i]=='#')s+=1;
      }
      if(s==0){
        a.front().erase(a.front().begin() + i);
        x+=1;
      }
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:7: error: redeclaration of 'int x'
   27 |   int x=1;
      |       ^
a.cc:13:7: note: 'int x' previously declared here
   13 |   int x=1;
      |       ^
Language: C++

#include <iostream>
using namespace std;
int main(){
  int h, w, i, j;
  cin >> h >> w;
  int a[h][w];
  for(i=0;i<h; i++)
    for(j=0; j<w; j++)
      cin >> a[i][j];
  
  for(i=0; i<h; i++){
    int flag=0;
    for(j=0; j<w; j++){
      if(a[i][j]==".") flag++;
    }
    if(flag==w){
       for(j=0; j<w; j++){
	 a[i][j]=0;
       }}
  }

  for(j=0; j<w;j++){
    int flag=0;
    for(i=0; i<h; i++){
      if(a[i][j]=="."||a[i][j]==0) flag++;
    }
    if(flag==h){
      for(i=0;i<h; i++){
	a[i][j]=0;
      }}
  }
  

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |       if(a[i][j]==".") flag++;
      |          ~~~~~~~^~~~~
a.cc:25:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   25 |       if(a[i][j]=="."||a[i][j]==0) flag++;
      |          ~~~~~~~^~~~~