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

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

int main () {
  int H, W;
  cin >> H >> W;
  vector<string> phase(H);
  for (int i = 0; i < H; i++) {
    cin >> phase.at(i);
  }
  //ここまでで一応元のデータは入れ終えた
  vector<bool> vertical(H, true), horizontal(W, true);
  for (int j = 0; j < W; j++) {
    for (int i = 0; i < H; i++) {
      if(phase.at(i).at(j) != '.') {
        horizontal.at(j) = false;
        break;
      }
    }
  }
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      if(phase.at(i).at(j) != '.') {
        vertical.at(i) = false;
        break;
      }
    }
  }
  for (int j = 0; j < H; j++) {
    for (int i = 0; i < W; i++) {
      if(vertical.at(j) == false && horizontal.at(i) == false) {
        cout << phase.at(j).at(i);
      }
    }
    cout << endl;
  }
  

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

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

int main() {
  int N, M;
  cin >> N >> M;
  vector<string> res;
  for (int i = 0; i < N; ++i) {
    string str;
    cin >> str;
    if (str == string(M, '.')) continue;
    res.push_back(str);
  }
  
  for (int j = 0; j < res[0].size(); ++j) {
    bool all = true;
    for (int i = 0; i < res.size(); ++i) {
      if (res[i][j] != '.') all = false;
    }
    if (all) {
      for (int i = 0; i < res.size(); ++i) {
       	res[i].erase(res[i].begin() + j); 
      }
      --j:
    }
  }
  for (int i = 0; i < res.size(); ++i) {
    cout << res[i] << endl;
  }
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:24:10: error: expected ';' before ':' token
   24 |       --j:
      |          ^
      |          ;
Language: C++

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

int main() {
  int N, M;
  cin >> N >> M;
  vector<string> res;
  for (int i = 0; i < N; ++i) {
    string str;
    cin >> str;
    if (str == string(M, '.')) continue;
    res.push_back(str);
  }
  
  for (int j = 0; j < res[0].size(); ++j) {
    bool all = true;
    for (int i = 0; i < N; ++i) {
      if (res[i][j] != '.') all = false;
    }
    if (all) {
      for (int i = 0; i < N; ++i) {
       	res[i].erase(res[i].begin() + j); 
      }
      --j:
    }
  }
  for (int i = 0; i < res.size(); ++i) {
    cout << res[i] << endl;
  }
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:24:10: error: expected ';' before ':' token
   24 |       --j:
      |          ^
      |          ;
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));
    for(int i = 0; i < H; i++){
        for(int j = 0; j < W; j++){
            cin >> a.at(i).at(j);
        }
    }
    int row = H;
    int col = W;
    set<int> memorow;
    set<int> memocol;
    for(int i = 0; i < H; i++){
        for(int j = 0; j < W; j++){
            if(j == W - 1 && a.at(i).at(j) == '.'){
                memorow.insert(i);
                row--;
            }
            if(a.at(i).at(j) == '#'){
                break;
            }
        }
    }
    for(int i = 0; i < W; i++){
        for(int j = 0; j < H; j++){
            if(j == H - 1 && a.at(j).at(i) == '.'){
                memocol.insert(i);
                col--;
            }
            if(a.at(j).at(i) == '#'){
                break;
            }
        }
    }
    vector<vector<char>> revised(row, vector<char>(col));
    int x = 0;
    int y = 0;
    for(int i = 0; i < H; i++){
        bool flag1 = false;
        for(int k = 0; k < memorow.size(); k++){
            if(i == memorow.at(k)){
                flag1 = true;
                break;
            }
        }
        if(flag1){
            continue;
        }
        for(int j = 0; j < W; j++){
            bool flag2 = false;
            for(int k = 0; k < memocol.size(); k++){
                if(j == memocol.at(k)){
                    flag2 = true;
                    break;
                }
            }
            if(flag2){
                continue;
            }
            revised.at(x).at(y) = a.at(i).at(j);
            cout << revised.at(x).at(y);
            y++;
        }
        x++;
        cout << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:29: error: 'class std::set<int>' has no member named 'at'
   45 |             if(i == memorow.at(k)){
      |                             ^~
a.cc:56:33: error: 'class std::set<int>' has no member named 'at'
   56 |                 if(j == memocol.at(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));
    for(int i = 0; i < H; i++){
        for(int j = 0; j < W; j++){
            cin >> a.at(i).at(j);
        }
    }
    int row = H;
    vector<int> memo;
    for(int i = 0; i < H; i++){
        for(int j = 0; j < W; j++){
            if(j == W - 1 && a.at(i).at(j) == '.'){
                memo.push_back(i);
                row--;
            }
            if(a.at(i).at(j) == '#'){
                break;
            }
        }
    }
    vector<vector<char>> revised(row, vector<char>(W));
    for(int i = 0; i < H; i++){
        for(int j = 0; j < W; j++){
            bool flag = false;
            for(int k = 0; k < memo.size(); k++){
                if(i == memo.(k)){
                    flag = true;
                    break;
                }
            }
            if(flag){
                continue;
            }
            revised.at(i).at(j) = a.at(i).at(j);
            cout << revise.at(i).at(j);
        }
        cout << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:30: error: expected unqualified-id before '(' token
   31 |                 if(i == memo.(k)){
      |                              ^
a.cc:40:21: error: 'revise' was not declared in this scope; did you mean 'revised'?
   40 |             cout << revise.at(i).at(j);
      |                     ^~~~~~
      |                     revised
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
int main() {
  int M, N;
  cin >> M >> N;
  vector<string> vec(M);
  rep(i, M) {
    cin >> vec.at(i);
  }
  int c = 0;
  rep(i, M) {
    rep(j, N) {
      if(vec.at(i).at(j) == '.') {
        c++;
      }
      if(c == N) {
        rep(k, N - 1) {
          vec.at(i).at(k) = vec.at(i).at(k + 1);
        }
        vec.at(M).at(N) = ' ';
      }
    }
    N--;
    c = 0;
  }
  rep(i, N) {
    rep(j, M) {
      if(vec.at(j).at(i) == '.') {
        c++;
      }
      if(c == M) {
        rep(k, M - 1) {
          vec.at(k).at(i) = vec.at(k + 1).at(i);
        }
        vec.at(j).at(i) = ' ';
      }
    }
    M--;
    c = 0;
  }
  rep(i, M) {
    cout << vector.at(M) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:19: error: missing template arguments before '.' token
   45 |     cout << vector.at(M) << endl;
      |                   ^
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[i];
	}
 
	vector<bool> gyou(h, false),retu(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: In function 'int main()':
a.cc:16:33: error: 'row' was not declared in this scope; did you mean 'pow'?
   16 |                                 row[i] = true;
      |                                 ^~~
      |                                 pow
a.cc:17:33: error: 'col' was not declared in this scope; did you mean 'cosl'?
   17 |                                 col[j] = true;
      |                                 ^~~
      |                                 cosl
a.cc:23:21: error: 'row' was not declared in this scope; did you mean 'pow'?
   23 |                 if (row[i]) {
      |                     ^~~
      |                     pow
a.cc:25:37: error: 'col' was not declared in this scope; did you mean 'cosl'?
   25 |                                 if (col[j]) {
      |                                     ^~~
      |                                     cosl
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int  H , W ;
  cin >> H >> W;
  vector <bool> gyou(H,false) , retu(W, false);
  vector <string> s(H) ;
  for ( int i=0 ; i<H ; i++ ){
    cin >> s[i] ;
  }
  for ( int i=0 ; i<H ; i++){
    for (int j= 0 ; j <W ;j++){
      if (s.at(i).at(j) == '#' ) {
        gyou.at(i) = true ;
        retu.at(j) = true ;
      }
    }
  }
    for ( int i=0 ; i<H ; i++){
    for (int j= 0 ; j <W ;j++){
      if ( gyou.at(i) && retu.at(j)) {
      cout << s.at(i).at(j)  
      }
    }
      cout << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:28: error: expected ';' before '}' token
   23 |       cout << s.at(i).at(j)
      |                            ^
      |                            ;
   24 |       }
      |       ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int  H , W ;
  cin >> H >> W;
  vector <bool> gyou(H,false) , retu(W, false);
  vector <string> s(H) ;
  for ( int i=0 ; i<H ; i++ ){
    cin >> s(i) ;
  }
  for ( int i=0 ; i<H ; i++){
    for (int j= 0 ; j <W ;j++){
      if (s.at(i).at(j) == '#' ) {
        gyou.at(i) = true ;
        retu.at(j) = true ;
      }
    }
  }
    for ( int i=0 ; i<H ; i++){
    for (int j= 0 ; j <W ;j++){
      if ( gyou.at(i) && retu.at(j)) {
      cout << s.at(i).at(j)  
      }
    }
      cout << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   10 |     cin >> s(i) ;
      |            ~^~~
a.cc:23:28: error: expected ';' before '}' token
   23 |       cout << s.at(i).at(j)
      |                            ^
      |                            ;
   24 |       }
      |       ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int  H , W ;
  cin >> H >> W;
  vector <bool> gyou(H,false) , retu(W, false);
  vector < string > s(H) ;
  for ( int i=0 ; i<H ; i++ ){
    cin >> s(i) ;
  }
  for ( int i=0 ; i<H ; i++){
    for (int j= 0 ; j <W ;j++){
      if (s.at(i).at(j) == '#' ) {
        gyou.at(i) = true ;
        retu.at(j) = true ;
      }
    }
  }
    for ( int i=0 ; i<H ; i++){
    for (int j= 0 ; j <W ;j++){
      if ( gyou.at(i) && retu.at(j)) {
      cout << s.at(i).at(j)  
      }
    }
      cout << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   10 |     cin >> s(i) ;
      |            ~^~~
a.cc:23:28: error: expected ';' before '}' token
   23 |       cout << s.at(i).at(j)
      |                            ^
      |                            ;
   24 |       }
      |       ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, m, count, p, q;
  cin >> h >> m;
  vector<vector<char>>  list(100,vector<char>(100));
  for(int i=0;i<h;i++) {
    for(int j=0;j<m;j++) {
      cin >> list.at(i).at(j);
    }
  }
 
    for(int i=0;i<h;i++) {
    count = 0;
    for(int j=0;j<m;j++) {
      if(list.at(i).at(j) == '#') {
        count++;
      }
    }
    if(count == 0) {
      p++;
      
    }
  }
  
   for(int i=0;i<m;i++) {
    count = 0;
    for(int j=0;j<h;j++) {
      if(list.at(j).at(i) == '#') {
        count++;
      }
    }
    if(count == 0) {
      q++;
      
    }
  }
  
  
  for(int i=0;i<h;i++) {
    count = 0;
    for(int j=0;j<m;j++) {
      if(list.at(i).at(j) == '#') {
        count++;
      }
    }
    if(count == 0) {
      for(int k=i;k<h;k++) {
        for(int l=0;l<m;l++) {
          swap(list.at(k).at(l) , list.at(k+1).at(l));
        }
      }
      
    }
  }
  
   for(int i=0;i<m;i++) {
    count = 0;
    for(int j=0;j<h;j++) {
      if(list.at(j).at(i) == '#') {
        count++;
      }
    }
    if(count == 0) {
      for(int k=i;k<h;k++) {
        for(int l=0;l<m;l++) {
          swap(list.at(l).at(k) , list.at(l).at(k+1));
        }
      }
      
      
    }
  }

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

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
  int H,W; cin>>H>>W;
  vector<bool>A(H+W,true);
  vecotr<vector<char>>B(H,vector<char>(W));
  rep(i,H){
    string S; cin>>S;
    rep(j,W){B[i][j]=S.at(j);if(S.at(j)=='#'){A[i]=false; A[H+j]=false;}}
  }
  rep(i,H){
    bool D=false;
    rep(j,W){A[i]&&A[H+j]){cout<<B[i][j]<<endl; D=true;}}
    if(D==true)cout<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vecotr' was not declared in this scope
    7 |   vecotr<vector<char>>B(H,vector<char>(W));
      |   ^~~~~~
a.cc:7:21: error: expected primary-expression before '>' token
    7 |   vecotr<vector<char>>B(H,vector<char>(W));
      |                     ^~
a.cc:7:23: error: 'B' was not declared in this scope
    7 |   vecotr<vector<char>>B(H,vector<char>(W));
      |                       ^
a.cc:14:26: error: expected ';' before ')' token
   14 |     rep(j,W){A[i]&&A[H+j]){cout<<B[i][j]<<endl; D=true;}}
      |                          ^
      |                          ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int H,W; cin>>H>>W;
  vector<vector<char>>B(H,vector<char>(W,'.'));
  rep(i,H){
    string S; cin>>S;
    rep(j,W){
      if(S.at(j)=='#')B[i][j]=='#';
    }
  }
  vector<vector<bool>>C(H,vector<bool>(W,true));
  rep(i,H){
    rep(j,W){
      if(B[i][j]=='#')break;
      if(j==W-1)rep(k,W)C[i][k]=false;        
    }
  }
  rep(i,W){
    rep(j,H){
      if(B[j][i]=='#')break;
      if(j==H-1)rep(k,H)C[k][i]=false;
    }
  }
  rep(i,H){
    bool D=false;
    rep(j,W){if(C[i][j]==true){cout<<B[i][j]<<endl; D=true;}}
    if(D==true)cout<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: 'i' was not declared in this scope
    6 |   rep(i,H){
      |       ^
a.cc:6:3: error: 'rep' was not declared in this scope
    6 |   rep(i,H){
      |   ^~~
Language: C++

#include <bits/stdc++.h>

using namespace std;


int number_of_row,number_of_column;
int i,j,count_dotto,k,l;

int main() {
  cin >> number_of_row>>number_of_column;
  
  vector<vector<char>> data(number_of_row,vector<char>(number_of_column));
  
  
  for ( i = 0; i < number_of_row; i++) {
    // i番目の状態を読む
    for ( j = 0; j < number_of_column; j++) {
      
        cin >> data.at(i).at(j);
      }
    }
	
  
 

  for ( i = 0; i < number_of_row; i++) {
    count_dotto = 0;
    for ( j = 0; j < number_of_column; j++) {
      
        if (data.at(i).at(j) == '.') {
          count_dotto++;
        }
	
      }
      if (count_dotto == number_of_column){
        for (k = i;k < number_of_row-1;k++){
          data.at(k) = data.at(k+1);  
        }
        number_of_row--;
      }
    
    }

  for ( j = 0; j < number_of_column; j++) {
    count_dotto = 0;
    for ( i = 0; i < number_of_raw; i++) {
      if (data.at(i).at(j) == '.') {
          count_dotto++;
        }
    }
    if(count_dotto == number_of_row){
      for(l = 0;l< number_of_column-1;l++){
        for(k = j;k< number_of_row-1;k++){
          data.at(l).at(k) = data.at(l).at(k+1);
          }
      }
     number_of_column --;
    }
  }

    for ( i = 0; i < number_of_row; i++) {
      count_dotto = 0;
      for ( j = 0; j < number_of_column; j++) {
        cout << data.at(i).at(j) ;
      }
      cout << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:22: error: 'number_of_raw' was not declared in this scope; did you mean 'number_of_row'?
   46 |     for ( i = 0; i < number_of_raw; i++) {
      |                      ^~~~~~~~~~~~~
      |                      number_of_row
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int H, W;
  cin >> H >> W;
  vector<vector<int>> square(H,vector<int>(W));
  for(int i=0; i<H; i++){
    for(int j=0; j<W; j++){
       char a;
      cin >> a;
      if(a == '#'){
      	square.at(i).at(j) = 1;
      }
      else{
      	square.at(i).at(j) = 0;
      }
    }
  }
  
  for(int i=0; i < H ; i++){
  	for(int j=0; j < W-1 ;j++){
    	if(square.at(i).at(j) == 1) break;
      	if(j==W-1) square.erase(square.begin() + i);
    }
  }
  for(int i=0; i < W ; i++){
  	for(int j=0; j < H-1; j++){
    	if(square.at(j).at(i) == 1) break;
      	if(j == H-1){
        	for(int k=0; k < H; k++){
            	square.erase(square.at(k).begin() + i);
            }
        }
    }
  }
  
  for(int i=0; i<H; i++){
    for(int j=0; j<W; j++){
      if(square.at(i).at(j) == 0){
      	cout << '.' << endl;
      }
      else{
      	cout << '#' << endl;
      }
    }
    cout << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:29: error: no matching function for call to 'std::vector<std::vector<int> >::erase(__gnu_cxx::__normal_iterator<int*, std::vector<int> >)'
   32 |                 square.erase(square.at(k).begin() + i);
      |                 ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
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:1536:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; iterator = std::vector<std::vector<int> >::iterator; const_iterator = std::vector<std::vector<int> >::const_iterator]'
 1536 |       erase(const_iterator __position)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1536:28: note:   no known conversion for argument 1 from '__normal_iterator<int*,vector<int>>' to '__normal_iterator<const std::vector<int>*,vector<std::vector<int>>>'
 1536 |       erase(const_iterator __position)
      |             ~~~~~~~~~~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator, const_iterator) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; iterator = std::vector<std::vector<int> >::iterator; const_iterator = std::vector<std::vector<int> >::const_iterator]'
 1564 |       erase(const_iterator __first, const_iterator __last)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note:   candidate expects 2 arguments, 1 provided
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int H, W;
  cin >> H >> W;
  vector<vector<char>> square(H,vector<char>(W));
  for(int i=0; i<H; i++){
    for(int j=0; j<W; j++){
      if)
      cin >> square.at(i).at(j);
    }
  }
  
  for(int i=0; i < H ; i++){
  	for(int j=0; j < W-1 ;j++){
    	if(square.at(i).at(j) == '#') break;
      	if(j==W-1) square.erase(square.begin() + i);
    }
  }
  for(int i=0; i < W ; i++){
  	for(int j=0; j < H-1; j++){
    	if(square.at(j).at(i) == '#') break;
      	if(j == H-1){
        	for(int k=0; k < H; k++){
            	square.erase(square.at(k).begin() + i);
            }
        }
    }
  }
  
  for(int i=0; i<H; i++){
    for(int j=0; j<W; j++){
      cout << square.at(i).at(j) << endl;
    }
    cout << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: expected '(' before ')' token
   10 |       if)
      |         ^
      |         (
a.cc:26:29: error: no matching function for call to 'std::vector<std::vector<char> >::erase(__gnu_cxx::__normal_iterator<char*, std::vector<char> >)'
   26 |                 square.erase(square.at(k).begin() + i);
      |                 ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
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:1536:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator) [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >; iterator = std::vector<std::vector<char> >::iterator; const_iterator = std::vector<std::vector<char> >::const_iterator]'
 1536 |       erase(const_iterator __position)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1536:28: note:   no known conversion for argument 1 from '__normal_iterator<char*,vector<char>>' to '__normal_iterator<const std::vector<char>*,vector<std::vector<char>>>'
 1536 |       erase(const_iterator __position)
      |             ~~~~~~~~~~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator, const_iterator) [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >; iterator = std::vector<std::vector<char> >::iterator; const_iterator = std::vector<std::vector<char> >::const_iterator]'
 1564 |       erase(const_iterator __first, const_iterator __last)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note:   candidate expects 2 arguments, 1 provided
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int H, W;
  cin >> H >> W;
  vector<vector<char>> square(H,vector<char>(W));
  for(int i=0; i<H; i++){
    for(int j=0; j<W; j++){
      cin >> square.at(i).at(j);
    }
  }
  
  for(int i=0; i < H ; i++){
  	for(int j=0; j < W-1 ;j++){
    	if(square.at(i).at(j) != square.at(i).at(j+1)) break;
      	if(j==W-1) square.erase(square.begin() + i);
    }
  }
  for(int i=0; i < W ; i++){
  	for(int j=0; j < H-1; j++){
    	if(square.at(j).at(i) != square.at(j+1).at(i)) break;
      	if(j == H-1){
        	for(int k=0; k < H; k++){
            	square.erase(square.at(k).begin() + i);
            }
        }
    }
  }
  
  for(int i=0; i<H; i++){
    for(int j=0; j<W; j++){
      cout << square.at(i).at(j) << endl;
    }
    cout << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:29: error: no matching function for call to 'std::vector<std::vector<char> >::erase(__gnu_cxx::__normal_iterator<char*, std::vector<char> >)'
   25 |                 square.erase(square.at(k).begin() + i);
      |                 ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
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:1536:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator) [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >; iterator = std::vector<std::vector<char> >::iterator; const_iterator = std::vector<std::vector<char> >::const_iterator]'
 1536 |       erase(const_iterator __position)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1536:28: note:   no known conversion for argument 1 from '__normal_iterator<char*,vector<char>>' to '__normal_iterator<const std::vector<char>*,vector<std::vector<char>>>'
 1536 |       erase(const_iterator __position)
      |             ~~~~~~~~~~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator, const_iterator) [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >; iterator = std::vector<std::vector<char> >::iterator; const_iterator = std::vector<std::vector<char> >::const_iterator]'
 1564 |       erase(const_iterator __first, const_iterator __last)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note:   candidate expects 2 arguments, 1 provided
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int H, W;
  bool is_point_w = true;
  bool is_point_h = true;
  cin >> H >> W;
  vector<vector<char>> square(H,vector<char>(W));
  for(int i=0; i<H; i++){
    for(int j=0; j<W; j++){
      cin >> square.at(i).at(j);
    }
  }
  
  for(int i=0; i < H ; i++){
  	for(int j=0; j < W-1 ;j++){
    	if(square.at(i).at(j) != square.at(i).at(j+1)) break;
      	if(j==W-1) square.erase(square.begin() + i);
    }
  }
  for(int i=0; i < W ; i++){
  	for(int j=0; j < H-1; j++){
    	if(square.at(j).at(i) != square.at(j+1).at(i)) break;
      	if(j == H-1){
        	for(int k=0; k < H; k++){
            	square.erase(square.at(k).begin() + i);
            }
        }
    }
  }
  
  for(int i=0; i<H; i++){
    for(int j=0; j<W; j++){
      cout << square.at(i).at(j) << endl;
    }
    cout << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:29: error: no matching function for call to 'std::vector<std::vector<char> >::erase(__gnu_cxx::__normal_iterator<char*, std::vector<char> >)'
   27 |                 square.erase(square.at(k).begin() + i);
      |                 ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
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:1536:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator) [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >; iterator = std::vector<std::vector<char> >::iterator; const_iterator = std::vector<std::vector<char> >::const_iterator]'
 1536 |       erase(const_iterator __position)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1536:28: note:   no known conversion for argument 1 from '__normal_iterator<char*,vector<char>>' to '__normal_iterator<const std::vector<char>*,vector<std::vector<char>>>'
 1536 |       erase(const_iterator __position)
      |             ~~~~~~~~~~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator, const_iterator) [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >; iterator = std::vector<std::vector<char> >::iterator; const_iterator = std::vector<std::vector<char> >::const_iterator]'
 1564 |       erase(const_iterator __first, const_iterator __last)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note:   candidate expects 2 arguments, 1 provided
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int H, W;
  bool is_point_w = true;
  bool is_point_h = true;
  cin >> H >> W;
  vector<vector<char>> square(H,vector<char>(W));
  for(int i=0; i<H; i++){
    for(int j=0; j<W; j++){
      cin >> square.at(i).at(j);
    }
  }
  
  for(int i=0; i < H ; i++){
  	for(int j=0; j < W-1 ;j++){
    	if(square.at(i).at(j) != square.at(i).at(j+1)) break;
      	if(j==W-1) square.erase(square.begin + i);
    }
  }
  for(int i=0; i < W ; i++){
  	for(int j=0; j < H-1; j++){
    	if(square.at(j).at(i) != square.at(j+1).at(i)) break;
      	if(j == H-1){
        	for(int k=0; k < H; k++){
            	square.erase(square.at(k).begin + i);
            }
        }
    }
  }
  
  for(int i=0; i<H; i++){
    for(int j=0; j<W; j++){
      cout << square.at(i).at() << endl;
    }
    cout << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:46: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
   19 |         if(j==W-1) square.erase(square.begin + i);
      |                                 ~~~~~~~~~~~~ ^ ~
      |                                        |       |
      |                                        |       int
      |                                        <unresolved overloaded function type>
a.cc:27:49: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
   27 |                 square.erase(square.at(k).begin + i);
      |                              ~~~~~~~~~~~~~~~~~~ ^ ~
      |                                           |       |
      |                                           |       int
      |                                           <unresolved overloaded function type>
a.cc:35:30: error: no matching function for call to 'std::vector<char>::at()'
   35 |       cout << square.at(i).at() << endl;
      |               ~~~~~~~~~~~~~~~^~
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:1180:7: note: candidate: 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::at(size_type) [with _Tp = char; _Alloc = std::allocator<char>; reference = char&; size_type = long unsigned int]'
 1180 |       at(size_type __n)
      |       ^~
/usr/include/c++/14/bits/stl_vector.h:1180:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_vector.h:1199:7: note: candidate: 'std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::at(size_type) const [with _Tp = char; _Alloc = std::allocator<char>; const_reference = const char&; size_type = long unsigned int]'
 1199 |       at(size_type __n) const
      |       ^~
/usr/include/c++/14/bits/stl_vector.h:1199:7: note:   candidate expects 1 argument, 0 provided
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int H, W;
  cin >> H >> W;
  vector<vector<int>> A(H);
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      cin >> A.at(i).at(j);
    }
  }
  int w_count, h_count = 0;
  unordered_map<int, bool> rem_r, rem_c;
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      if (A.at(i).at(j) == '.') {
        w_count++;
      }
    }
    if (w_count == W) {
      rem_r[i] = true;
    }
    w_count = 0;
  }
  
  for (int j = 0; j < W; j++) {
    for (int i = 0; i < H; i++) {
      if (A.at(i).at(j) == '.') {
        h_count++;
      }
    }
    if (h_count == H) {
      rem_c[j] = true;
    }
    h_count = 0;
  }
  
  vector<vector<int>> ans(H - rem_r.size());
  for (int i = 0; i < H; i++) {
    if (rem_r.find(i) != rem_r.end()) {
      for (int j = 0; j < W; j++) {
        if (rem_c.find(j) != rem_c.end()) {
          ans.at(i).push_back(A.at(i).at(j));
        }
    }
    }
  }
  
  for (int i = 0; i < ans.size(); i++) {
    for (int j = 0; j < ans.at(0).size(); j++) {
      cout << ans.at(i).at(j) << ' ';
    }
    cout << ans.at(i).at(j) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:54:26: error: 'j' was not declared in this scope
   54 |     cout << ans.at(i).at(j) << endl;
      |                          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char> cvec;
typedef vector<double> dvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
#define fs first
#define sc second
int main()	{
  int h.w;
  cin>>h>>w;
  vector<string>s(h);
  rep(i,h) cin>>s[i];
  vector<bool>l(h,false),r(w,false);
  rep(i,h)rep(j,w){
    if(s[i][j]=='#'){
      l[i]=true;
      r[j]=true;
    }
  }
  rep(i,h){
    if(l[i]){
      rep(j,w){
        if(r[j])
          cout<<s[i][j];
      }
      cout<<endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:8: error: expected initializer before '.' token
   19 |   int h.w;
      |        ^
a.cc:20:8: error: 'h' was not declared in this scope
   20 |   cin>>h>>w;
      |        ^
a.cc:20:11: error: 'w' was not declared in this scope
   20 |   cin>>h>>w;
      |           ^
Language: C++

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

int main() {
  int N, M;
  cin >> N >> M;
  vector<vector<char>> masu(N, vector<char>(M)) ;
  for (int i = 0; i < N; i++) {
    for(int j = 0; j < M; j++){
      cin >> masu.at(i).at(j);
    }
  }
  
  vector<vector<char>> ans(N, vector<char>(M)) ;
  int count = 0, time1 = 0, time2 = 0;
  for(int i = 0; i < N; i++){
    for(int j = 0; j < N; j++){
      if(masu.at(i).at(j) == '.'){
        count ++;
      }
    }
    if(count == N){
      time1 ++;
      break;
    }
    else{
      ans.at(i-time1) = masu.at(i);
    }
  }
vector<vector<char>> ans2(N-time1, vector<char>(M)) ;
  for (int i = 0; i < N - time1; i++) {
    for(int j = 0; j < M; j++){
      ans2.at(i).at(j) = ans.at(i).at(j);
    }
  }
    int count = 0;
vector<vector<char>> ans3(N-time1, vector<char>(M)) ;
    for(int i = 0; i < N; i++){
    for(int j = 0; j < N - time1; j++){
      if(ans2.at(j).at(i) == '.'){
        count ++;
      }
    }
    if(count == N){
      time2 ++;
      break;
    }
    else{
      ans3.at(i-time2) = ans1.at(i);
    }
  }
 vector<vector<char>> ans4(N-time1, vector<char>(M-time2)) ;
    for (int i = 0; i < N - time1; i++) {
    for(int j = 0; j < M - time2; j++){
      ans4.at(i).at(j) = ans3.at(i).at(j);
    }
  }
      
  for (int i = 0; i < N - time1; i++) {
    for(int j = 0; j < N - time2; j++){
      cout << ans4.at(i).at(j);
      if (j == N - time2 -1) {
        cout << endl; // 末尾なら改
      }
      else {
        cout << " ";  // それ以外なら空白
      }
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:9: error: redeclaration of 'int count'
   36 |     int count = 0;
      |         ^~~~~
a.cc:15:7: note: 'int count' previously declared here
   15 |   int count = 0, time1 = 0, time2 = 0;
      |       ^~~~~
a.cc:49:26: error: 'ans1' was not declared in this scope; did you mean 'ans3'?
   49 |       ans3.at(i-time2) = ans1.at(i);
      |                          ^~~~
      |                          ans3
Language: C++

#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

#define rep(i, n) for (ll i = 0; i < ll(n); i++)
#define repd(i, n) for (ll i = n - 1; i >= 0; i--)
#define all(x) x.begin(), x.end()

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int h, w;
    cin >> h >> w;
    vector<vector<char>> a(h, vector<char> (w));
    rep(i, h) {
        rep(j, w) {
            cin >> a[i][j];
        }
    }

    for(int i = 0; i < h;) {
        bool z = true;
        rep(j, w) {
            if(a[i][j] == '#') {z = false; break;}
        }
        if(z) {
            a.erase(a.begin() + i);
            h--;
        } else {
            i++;
        }
    }

    for(int j = 0; j < w;) {
        bool z = true;
        rep(i, h) {
            if(a[i][j] == '#') {z = false; break;}
        }
        if(z) {
            for(auto it = a.begin(); it != a.end(); it++) {
                a.erase(it->begin() + j);
            }
            w--;
        } else {
            j++;
        }
    }

    rep(i, h) {
        rep(j, w) {
            cout << a[i][j];
        }
        cout << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:24: error: no matching function for call to 'std::vector<std::vector<char> >::erase(__gnu_cxx::__normal_iterator<char*, std::vector<char> >)'
   43 |                 a.erase(it->begin() + 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:2:
/usr/include/c++/14/bits/stl_vector.h:1536:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator) [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >; iterator = std::vector<std::vector<char> >::iterator; const_iterator = std::vector<std::vector<char> >::const_iterator]'
 1536 |       erase(const_iterator __position)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1536:28: note:   no known conversion for argument 1 from '__normal_iterator<char*,vector<char>>' to '__normal_iterator<const std::vector<char>*,vector<std::vector<char>>>'
 1536 |       erase(const_iterator __position)
      |             ~~~~~~~~~~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator, const_iterator) [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >; iterator = std::vector<std::vector<char> >::iterator; const_iterator = std::vector<std::vector<char> >::const_iterator]'
 1564 |       erase(const_iterator __first, const_iterator __last)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note:   candidate expects 2 arguments, 1 provided
Language: C++

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

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

  // ここにプログラムを追記
  // (ここで"試合結果の表"の2次元配列を宣言)
  cnt_h = 0;
  for(int i=0; i<H; i++){
    cnt_w = 0;
    for(int j=0; j<W; j++){
      if(square.at(i).at(j)=='.'){
        cnt_w++;
      }
      if( cnt_w == j )square.erase(square.begin() + i);
      if(i == 0 && square.at(i).at(j) == '.'){
        temp = j;
      }
      else if(square.at(i).at(temp))cnt_h++;
    }
  }
  string mark;
  for(int i=0;i<N;i++){
    for (int j = 0; j < N; j++) {
      if(scores.at(i).at(j) == 1)mark = 'o';
      else if(scores.at(i).at(j) == 2)mark = 'x';
      else mark = '-';
      cout << mark;
      if (j == N-1) {
          cout << endl; // 末尾なら改行
      }
      else {
          cout << " ";  // それ以外なら空白
      }
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:17: error: 'N' was not declared in this scope
   31 |   for(int i=0;i<N;i++){
      |                 ^
a.cc:33:10: error: 'scores' was not declared in this scope
   33 |       if(scores.at(i).at(j) == 1)mark = 'o';
      |          ^~~~~~
Language: C++

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

int main(){
  int h,w; //flag=1の時、一致している状態。loop中にflag=0となったらすぐにbreakする。
  cin >> h >> w;
  int flag1=0;
  vector<int> flag2(w,0); //縦の重複
  vector<string> lines(h);
  //入力
  for(int i=0;i<h;i++){
    cin >> lines.at(i);
  }
  //縦の重複の判断
  for(int i=0;i<w;i++){
    for(int j=0;j<h;j++){
      if(lines.at(j).at(i)=='.')flag1=1;
      else{
      	flag1=0;
      	break;
      }
    }
    if(flag1==1)flag2.at(i)=1;
    flag1=0;
  }
  
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      if(lines.at(i).at(j)!='.'){
      	flag1=0;
        break;
      }
      else flag1=1;
    }
    //出力フェーズ
    if(flag1!=1){
      for(int j=0;j<w;j++){
        if(flag2.at(j)!=1))cout << lines.at(i).at(j);
      }
    }
    flag=0;
    cout << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:27: error: expected primary-expression before ')' token
   38 |         if(flag2.at(j)!=1))cout << lines.at(i).at(j);
      |                           ^
a.cc:41:5: error: 'flag' was not declared in this scope; did you mean 'flag2'?
   41 |     flag=0;
      |     ^~~~
      |     flag2
Language: C

#include <stdio.h>
#define LIMIT 100
​
int main(void){
    int row,col,i,j,rowjudge[LIMIT]={0},coljudge[LIMIT]={0};
    char matrix[LIMIT][LIMIT];
    scanf("%d %d",&row,&col);
​
    // 初期化
    for(i=0; i<LIMIT; i++){
        for(j=0; j<LIMIT; j++){
            matrix[i][j]='\0';
        }
    }
​
    // 入力
    for(i=0; i<row; i++){
        for(j=0; j<col; j++){
            scanf(" %c",&matrix[i][j]);
        }
    }
​
    // 各行、各列に黒が１つでもあるかを判別
    for(i=0; i<row; i++){
        for(j=0; j<col; j++){
            if(matrix[i][j]=='#'){
                rowjudge[i]=1;
            }
        }
    }
    for(j=0; j<col; j++){
        for(i=0; i<row; i++){
            if(matrix[i][j]=='#'){
                coljudge[j]=1;
            }
        }
    }
​
    // 黒が１つでもある行と列の重なる要素のみを出力
    for(i=0; i<row; i++){
        for(j=0; j<col; j++){
            if(rowjudge[i]==1 && coljudge[j]==1){
                printf("%c",matrix[i][j]);
            }
        }
        if(rowjudge[i]==1){
            printf("\n");
        }
    }
    return 0;
}

Compiler output:
main.c:3:1: error: expected ';' before 'int'
    3 | ​
      | ^
      | ;
    4 | int main(void){
      | ~~~
main.c: In function 'main':
main.c:8:1: error: '\U0000200b' undeclared (first use in this function)
    8 | ​
      |  
main.c:8:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:1: error: expected ';' before 'for'
    8 | ​
      | ^
      | ;
    9 |     // 初期化
   10 |     for(i=0; i<LIMIT; i++){
      |     ~~~
Language: C

/* ex 7_3
   アカウント名 */

#include <stdio.h>
#include <stdlib.h>


int main(void){
    int i, j, k, row, column;
    scanf("%d %d\n", &row, &column);
    int row_flag[row] = {0}, column_flag[column] = {0};
    char matrix[row][column];
    for(i = 0; i < row; i++){
        for(j = 0; j < column; j++){
            scanf(" %c", &matrix[i][j]);
            if(matrix[i][j] == '#'){
                row_flag[i] = 1;
                column_flag[j] = 1;
            }
        }
    }

    for(i = 0; i < row; i++){
        k = 0;
        for(j = 0; j < column; j++){
            if(row_flag[i] == 1 && column_flag[j] == 1){
                printf("%c", matrix[i][j]);
                k = 1;
            }
        }
        if(k == 1){
            printf("\n");
        }
    }

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:25: error: variable-sized object may not be initialized except with an empty initializer
   11 |     int row_flag[row] = {0}, column_flag[column] = {0};
      |                         ^
main.c:11:52: error: variable-sized object may not be initialized except with an empty initializer
   11 |     int row_flag[row] = {0}, column_flag[column] = {0};
      |                                                    ^
Language: C

/*  ex7_3
    potter0723sw  */

#include <stdio.h>
#include <stdlib.h>
void error(void){
    fprintf(stderr, "memory allocation error.\n")//エラー出力を定義
}

int main(void){
    int row,column,i,j,*rowblack,*colblack;
    char **matrix;
    scanf("%d %d",&row,&column);
//matrixを確保
    matrix = (char**)calloc(row, sizeof(char*));
    if(matrix == NULL){
        error;
        exit(1);
    }
    for(i=0; i < row; i++){
        matrix[i] = (char*)calloc(column, sizeof(char));
        if(matrix[i] == NULL){
            error;
            exit(1);
        }
    }
//rowblackとcolblackも確保
    rowblack = (int*)calloc(row, sizeof(int));
    if(rowblack == NULL){
        error;
        exit(1);
    }
    colblack = (int*)calloc(column, sizeof(int));
    if(colblack == NULL){
        error;
        exit(1);
    }
//黒マスのある行と列を記憶
    for(i=0; i < row; i++){
        for(j=0; j<column;j++){
            scanf(" %c", &matrix[i][j]);
            if(matrix[i][j] == '#'){
                rowblack[i] += 1;
                colblack[j] += 1;
            }
        }
    }
//同じ行にも同じ列にも黒マスのあるマスのみ出力
    for(i=0; i < row; i++){
        for(j=0; j < column; j++){
            if(rowblack[i] != 0 && colblack[j] != 0){
                printf("%c", matrix[i][j]);
            }
        }
        if(rowblack[i] != 0){
            printf("\n");
        }
    }
//メモリ解放
    for(i=0; i < row; i++){
        free(matrix[i]);
    }
    free(matrix);
    free(rowblack);
    free(colblack);
    return 0;
}


Compiler output:
main.c: In function 'error':
main.c:7:50: error: expected ';' before '}' token
    7 |     fprintf(stderr, "memory allocation error.\n")//エラー出力を定義
      |                                                  ^
      |                                                  ;
    8 | }
      | ~
Language: C

/*  ex6_3
    potter0723sw  */

#include <stdio.h>
#include <stdlib.h>
#define  error fprintf(syderr, "memory allocation error.\n")//エラー出力を定義

int main(void){
    int row,column,i,j,*rowblack,*colblack;
    char **matrix;
    scanf("%d %d",&row,&column);
//matrixを確保
    matrix = (char**)calloc(row, sizeof(char*));
    if(matrix == NULL){
        error;
        exit(1);
    }
    for(i=0; i < row; i++){
        matrix[i] = (char*)calloc(column, sizeof(char));
        if(matrix[i] == NULL){
            error;
            exit(1);
        }
    }
//rowblackとcolblackも確保
    rowblack = (int*)calloc(row, sizeof(int));
    if(rowblack == NULL){
        error;
        exit(1);
    }
    colblack = (int*)calloc(column, sizeof(int));
    if(colblack == NULL){
        error;
        exit(1);
    }
//黒マスのある行と列を記憶
    for(i=0; i < row; i++){
        for(j=0; j<column;j++){
            scanf("　%c", &matrix[i][j]);
            if(matrix[i][j] == '#'){
                rowblack[i] += 1;
                colblack[j] += 1;
            }
        }
    }
//同じ行にも同じ列にも黒マスのあるマスのみ出力
    for(i=0; i < row; i++){
        for(j=0; j < column; j++){
            if(rowblack[i] != 0 && colblack[j] != 0){
                printf("%c", matrix[i][j]);
            }
        }
        if(rowblack[i] != 0){
            printf("\n");
        }
    }
//メモリ解放
    for(i=0; i < row; i++){
        free(matrix[i]);
    }
    free(matrix);
    free(rowblack);
    free(colblack);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:24: error: 'syderr' undeclared (first use in this function); did you mean 'stderr'?
    6 | #define  error fprintf(syderr, "memory allocation error.\n")//エラー出力を定義
      |                        ^~~~~~
main.c:15:9: note: in expansion of macro 'error'
   15 |         error;
      |         ^~~~~
main.c:6:24: note: each undeclared identifier is reported only once for each function it appears in
    6 | #define  error fprintf(syderr, "memory allocation error.\n")//エラー出力を定義
      |                        ^~~~~~
main.c:15:9: note: in expansion of macro 'error'
   15 |         error;
      |         ^~~~~
Language: C

/*  ex7_3
    yy8332  */

#include <stdio.h>
#include <stdlib.h>

int main(void){
  int height, width, i, j, k, num = 0;
  char **multi_array;

  //入力読み取り
  scanf("%d %d", &height, &width);

  //各行の配列へのポインタ分のメモリ領域を確保
  multi_array = (char**)calloc(height, sizeof(char*));
  if(multi_array == NULL){
      fprintf(stderr, "calloc error.\n");
      exit(1);
  }
  //各行の要素分のメモリ領域を確保
  for(i = 0; i < row; i++){
      multi_array[i] = (char*)calloc(width, sizeof(char));
      if(multi_array[i] == NULL){
          fprintf(stderr, "calloc error.\n");
          exit(1);
      }
  }

  for(i = 0; i < height; i++){
    for(j = 0; j < width; j++){
      scanf(" %c", &multi_array[i][j]);
    }
  }

  //横の操作
  for(i = 0; i < height; i++){

    for(j = 0; j < width; j++){
      if(multi_array[i][j] == '#'){
        num = 1;
      }
    }

    if(num == 0){
      height -= 1;
      for(k = i; k < height; k++){
        for(j = 0; j < width; j++){
          multi_array[k][j] = multi_array[k + 1][j];
        }
      }
      i -=1;
    }
    num = 0;
  }

  //縦の操作
  for(j = 0; j < width; j++){

    for(i = 0; i < height; i++){
      if(multi_array[i][j] == '#'){
        num = 1;
      }
    }

    if(num == 0){
      width -= 1;
      for(k = j; k < width; k++){
        for(i = 0; i < height; i++){
          multi_array[i][k] = multi_array[i][k + 1];
        }
      }
      j -=1;
    }
    num = 0;
  }


  //出力
  for(i = 0; i < height; i++){
    for(j = 0; j < width; j++){
      printf("%c", multi_array[i][j]);
    }
    printf("\n");
  }

  //メモリ領域の解放，各行の要素分の領域を開放し，
  //各行の配列へのポインタの領域を解放
  //（メモリ領域の確保と逆順）
  for(i = 0; i < row; i++){
      free(multi_array[i]);
  }
  free(multi_array);


  return 0;
}


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