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

/* ex 7_3
   unomi */
#include <stdio.h>
#include <stdlib.g>
#include <string.h>

int main(void){
    int row=0,column=0,i=0,j=0,temp=0;
    int flag_row[1000],flag_column[1000];
    char grid[1000][1000], **ptr;

    // 行数と列数 の入力を取得
    scanf("%d %d", &row, &column);



    // サイズrowのchar*型ポインタ配列を動的確保
    // 各行の配列へのポインタ分のメモリ領域を確保
    ptr = (char**)calloc(row,sizeof(char*));
    // エラー処理
    if(ptr == NULL){
        exit(1);
    }
    //各行の要素分のメモリ領域を確保
    for(i=0; i<row; i++){
        ptr[i] = (char*)calloc(column, sizeof(char));
        if(ptr[i] == NULL){
            exit(1);
        }
    }



    // grid[row][column] で入力を取得
    for(i=0; i<row; i++){
        for(j=0; j<column; j++){
            scanf(" %c", &temp);
            if (temp == '#') grid[i][j] = 1;
            else if (temp == ".") grid[i][j] = 0;
        }
    }

    for(i=0; i<row; i++){
        for(j=0; j<column; j++){
            printf("%c",grid[i][j]);
            // 黒のマスがあった場合
            if(grid[i][j]=='#'){
                // そのマスがある行と列に対してフラグを建てる
                flag_row[i] = 1;
                flag_column[j] = 1;
            }
        }
    }

    for(i=0; i<row; i++){
        for(j=0; j<column; j++){
            // 対象のマスの行か列に黒のマスがあるなら、表示
            if(flag_row[i]==1 && flag_column[j]==1) printf("%c",grid[i][j]);
        }
        // 現在の行に黒のマスがあるなら、改行
        if(flag_row[i]==1) printf("\n");
    }

    // 各行の要素分のメモリ領域を解放 -> 各行の配列へのポインタの領域を解放
    for(i=0; i<row; i++){
        free(ptr[i]);
    }
    free(ptr);

    return 0;
}

Compiler output:
main.c:4:10: fatal error: stdlib.g: No such file or directory
    4 | #include <stdlib.g>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

/* ex7_3
   YSK722 */

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

int main(void){
    int height, width;
    char **box1, **box2, **box3;
    scanf("%d %d", &height, &width);
    // 各行の配列へのポインタ分のメモリ領域を確保
    box1 = (char**)calloc(height, sizeof(char*));
    box2 = (char**)calloc(height, sizeof(char*));
    box3 = (char**)calloc(height, sizeof(char*));
    if (box1 == NULL || box2 == NULL || box3 == NULL){
        exit(1);
    }
    // 各行の要素分のメモリ領域を確保
    for (i = 0; i < height; i++){
        box1[i] = (char*)calloc(width, sizeof(char));
        if (box1[i] == NULL){
            exit(1);
        }
    }
    for (i = 0; i < height; i++){
        box2[i] = (char*)calloc(width, sizeof(char));
        if (box2[i] == NULL){
            exit(1);
        }
    }
    for (i = 0; i < height; i++){
        box3[i] = (char*)calloc(width, sizeof(char));
        if (box1[i] == NULL){
            exit(1);
        }
    }
    // 白黒を読み取る
    for (int i = 0; i < height; i++){
        for (int j = 0; j < width; j++){
                scanf(" %c", &box1[i][j]);
            }
        }
    /* i行の要素が全て白のとき、2つめのboxのi行目の
    要素をすべて"n"にし、それ以外の時はすべて"y"にする */
    for (int i = 0; i < height; i++){
        for (int j = 0; j < width; j++){
            if (box1[i][j] == '#'){
                for (int k = 0; k < width; k++){
                    box2[i][k] = 'y';
                }
                break;
            }
            box2[i][j] = 'n';
        }
    }
    /* j列の要素が全て白のとき、3つめのboxのj列目の
    要素をすべて"n"にし、それ以外の時はすべて"y"にする */
    for (int j = 0; j < width; j++){
        for (int i = 0; i < height; i++){
            if (box1[i][j] == '#'){
                for (int k = 0; k < height; k++){
                    box3[k][j] = 'y';
                }
                break;
            }
            box3[i][j] = 'n';
        }
    }
    /* 2つめ、3つめのboxの対応する要素がどちらとも"y"のときだけ
       boxの要素を出力する */
    for (int i = 0; i < height; i++){
        for (int j = 0; j < width; j++){
            if (box2[i][j] == 'y' && box3[i][j] == 'y'){
                printf("%c", box1[i][j]);
            }
        }
        printf("\n");
    }
    for (i = 0; i < height; i++){
        free(box1[i]);
    }
    free(box1);
    for (i = 0; i < height; i++){
        free(box2[i]);
    }
    free(box2);
    for (i = 0; i < height; i++){
        free(box3[i]);
    }
    free(box3);
    return 0;
}

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

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

int main() {
  int H, W;
  cin >> H >> W;
  vector<string> gyo(H);
  for (i =0; i < H; i++) {
    cin >> gyo.at(i);
  }
  vector<bool> tate(H, false);
  vector<bool> yoko(W, false);
  for (i = 0; i < H; i++) {
    for (j = 0; j < W; j++) {
      if (gyo.at(i).at(j) == '#') {
        tate.at(i) = true;
        yoko.at(j) = true;
      }
    }
  }
  for (i = 0; i < H; i++) {
    if (tate.at(i)) {
      for (j = 0; j < W; j++) {
        if(yoko.at(j)) {
          cout << gyo.at(i).at(j);
        }
      }
      cout << endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: 'i' was not declared in this scope
    8 |   for (i =0; i < H; i++) {
      |        ^
a.cc:13:8: error: 'i' was not declared in this scope
   13 |   for (i = 0; i < H; i++) {
      |        ^
a.cc:14:10: error: 'j' was not declared in this scope
   14 |     for (j = 0; j < W; j++) {
      |          ^
a.cc:21:8: error: 'i' was not declared in this scope
   21 |   for (i = 0; i < H; i++) {
      |        ^
a.cc:23:12: error: 'j' was not declared in this scope
   23 |       for (j = 0; j < W; j++) {
      |            ^
Language: C

/*ex7_3
 Sweet_Sweet_Soul */
#include <stdio.h>
#include <stdlib.h>

int main(void) {
    int hei,wid;/*hei=height、wid＝width*/
    int *hei_ture,*wid_ture;/*各行や列に'#'があれば1を記録する配列*/
    char **grid;/*入力用の多次元配列*/
    scanf("%d%d",&hei,&wid);
    grid=(char**)calloc(hei,sizeof(char*));/*まず各配列の先頭のポインタを確保*/
    if(grid==NULL){
        exit(1);
    }
    for(int i=0;i<hei;i++){
        grid[i]=(char*)calloc(wid,sizeof(char));/*各配列の要素を確保*/
        if(grid[i]==NULL){
            exit(1);
        }
    }
    hei_ture=(int*)calloc(hei,sizeof(int));/*他二つのtrue配列も確保*/
    if(hei_ture==NULL){
        exit(1);
    }
    wid_ture=(int*)calloc(wid,sizeof(int));
    if(wid_ture==NULL){
        exit(1);
    }
    for(int i=0;i<hei;i++){
        for(int j=0;j<wid;j++){
            scanf(" %c",&grid[i][j]);
            if(grid[i][j]=='#'){
                hei_ture[i]=1;/*真偽値を記録*/
                wid_ture[j]=1;
            }
        }
    }
    for(int i=0;i<hei;i++){
        if(hei_ture[i]==1){
            for(int j=0;j<wid;j++){
                if(wid_ture[j]==1){
                    printf("%c",grid[i][j]);/*行、列ともに真偽値1なら出力*/
                }
            }
        printf("\n");/*行ごとに改行*/
        }
    }
    /*先に各要素の配列のメモリを解放*/
    if(int i=0;i<hei,i++){
        free(grid[i]);
    }
    /*次に先頭のポインタを解放*/
    free(grid);
    free(hei_ture);
    free(wid_ture);
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:49:8: error: expected expression before 'int'
   49 |     if(int i=0;i<hei,i++){
      |        ^~~
main.c:50:19: error: 'i' undeclared (first use in this function)
   50 |         free(grid[i]);
      |                   ^
main.c:50:19: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <vector>
#include <string>
#include <iostream>
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: In function 'int main()':
a.cc:21:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   21 |       if (a[i][j] == "#"){
Language: C

/* ex7_3
  */

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

int main(void){
    int height, width; //変数の定義
    int i, j;
    char **ptr; //入力の表を記憶する二次元配列
    int *row ,*

    scanf("%d %d", &height, &width);

    ptr = (char**)calloc(height, sizeof(char*));
    if(ptr == NULL){
        exit(1);
    }
    for(i = 0; i < height; i++){
        ptr[i] = (char*)calloc(width, sizeof(char));
        if(ptr[i] == NULL){
            exit(1);
        }
    }


    for(i=0; i<height; i++){ //入力の表を二次元配列に記憶
        for(j=0; j<width; j++){
            scanf("%c", &ptr[i][j]);
        }
    }

    row = (int*)calloc(height, sizeof(int));
    if(row ==NULL){
        exit(1);
    }

    col = (int*)calloc(width, sizeof(int));
    if(col ==NULL){
        exit(1);
    }


    for(i=0; i<height; i++){ //二次元配列を全探索して、#がある行、列を記憶
        for(j=0; j<width; j++){
            if (ptr[i][j] == '#'){
                row[i] = 1;
                col[j] = 1;
            }
        }
    }
    for(i=0; i<height; i++){
        if(row[i] == 1){ //i番目の行に#が含まれている
            for(j=0; j<width; j++){
                if(col[j] == 1){ //j番目の列にも#が含まれている
                    printf("%c", ptr[i][j]);//出力
                }
            }
            printf("\n"); //一行出力したら改行
        }
    }

    for(i = 0; i < height; i++){
        free(ptr[i]);
    }
    free(ptr);

  
    free(row);
    free(col);
    

    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:13:11: error: expected declaration specifiers or '...' before string constant
   13 |     scanf("%d %d", &height, &width);
      |           ^~~~~~~
main.c:13:20: error: expected declaration specifiers or '...' before '&' token
   13 |     scanf("%d %d", &height, &width);
      |                    ^
main.c:13:29: error: expected declaration specifiers or '...' before '&' token
   13 |     scanf("%d %d", &height, &width);
      |                             ^
main.c:38:5: error: 'col' undeclared (first use in this function)
   38 |     col = (int*)calloc(width, sizeof(int));
      |     ^~~
main.c:38:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C

/* ex7_3
  */

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

int main(void){
    int height, width; //変数の定義
    int i, j;
    char **ptr; //入力の表を記憶する二次元配列
    int *row ,*

    scanf("%d %d", &height, &width);

    ptr = (char**)calloc(height, sizeof(char*));
    if(ptr == NULL){
        exit(1);
    }
    for(i = 0; i < height; i++){
        ptr[i] = (char*)calloc(width, sizeof(char));
        if(ptr[i] == NULL){
            exit(1);
        }
    }


    for(i=0; i<height; i++){ //入力の表を二次元配列に記憶
        for(j=0; j<width; j++){
            scanf("%c", &ptr[i][j]);
        }
    }

    row = (int*)calloc(height, sizeof(int));
    if(row ==NULL){
        exit(1);
    }

    col = (int*)calloc(width, sizeof(int));
    if(col ==NULL){
        exit(1);
    }


    for(i=0; i<height; i++){ //二次元配列を全探索して、#がある行、列を記憶
        for(j=0; j<width; j++){
            if (ptr[i][j] == '#'){
                row[i] = 1;
                col[j] = 1;
            }
        }
    }
    for(i=0; i<height; i++){
        if(row[i] == 1){ //i番目の行に#が含まれている
            for(j=0; j<width; j++){
                if(col[j] == 1){ //j番目の列にも#が含まれている
                    printf("%c", ptr[i][j]);//出力
                }
            }
            printf("\n"); //一行出力したら改行
        }
    }

    for(i = 0; i < height; i++){
        free(ptr[i]);
    }
    free(ptr);

  
        free(row);
    

   
        free(col);
    

    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:13:11: error: expected declaration specifiers or '...' before string constant
   13 |     scanf("%d %d", &height, &width);
      |           ^~~~~~~
main.c:13:20: error: expected declaration specifiers or '...' before '&' token
   13 |     scanf("%d %d", &height, &width);
      |                    ^
main.c:13:29: error: expected declaration specifiers or '...' before '&' token
   13 |     scanf("%d %d", &height, &width);
      |                             ^
main.c:38:5: error: 'col' undeclared (first use in this function)
   38 |     col = (int*)calloc(width, sizeof(int));
      |     ^~~
main.c:38:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C

/* ex7_3
   UMAboogie */
#include<stdio.h>
#include<stdlib.h>

int main(void){
  int height,width;
  char **grid;

  
  scanf("%d %d",&height,&width); //マスのたての数、横の数を入力
  
  //各行の配列へのポインタ分のメモリ領域を確保
  grid = (char**)calloc(height, sizeof(char*));
  if(grid == NULL){
    fprintf(stderr, "memory allocation error.\n");
    exit(1);
  }

  //各行の要素分のメモリ領域を確保
  for(int i=0;i<height;i++){
    grid[i] = (char*)calloc(width, sizeof(char));
    if(grid[i] == NULL){
      fprintf(stderr, "memory allocation error.¥n");
      exit(1);
    }
  }
  
  int row_exist[100]; //その行のマスに黒があるかの真偽値を入れる配列
  int col_exist[100]; //その列のマスに黒があるかの真偽値を入れる配列

  
  for(int i = 0;i < height;i++){
    for(int j = 0;j < width;j++){
      scanf(" %c",&grid[i][j]); //(i,j)の配色を入力
      if(grid[i][j] == '#'){ //もし黒であれば、各真偽値を1とする
        row_exist[i]=1;
        col_exist[j]=1;
      }
    }
  }
  for(int i = 0;i < height;i++){
    if(row_exist[i] == 1 ){ //まず黒がある行について
      for(int j = 0;j < width;j++){
        if(col_exist[j] == 1){ //黒がある列であれば
          printf("%c",grid[i][j]); //配色を出力
        }
      }
      printf("\n"); //行ごとに改行
    }
  }
  //メモリ領域の解放（逆順）
  for(i = 0; i < height; i++){
          free(grid[i]);
  }
  free(grid);
  
  return 0;
}


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

/* ex7_3
   UMAboogie */
#include<stdio.h>
#include<stdlib.h>

int main(void){
  int height,width;
  char **grid;

  
  scanf("%d %d",&height,&width); //マスのたての数、横の数を入力
  
  //各行の配列へのポインタ分のメモリ領域を確保
  grid = (char**)calloc(height, sizeof(char*));
  if(grid == NULL){
    fprintf(stderr, "memory allocation error.\n");
    exit(1);
  }

  各行の要素分のメモリ領域を確保
  for(int i=0;i<height;i++){
    grid[i] = (char*)calloc(width, sizeof(char));
    if(grid[i] == NULL){
      fprintf(stderr, "memory allocation error.¥n");
      exit(1);
    }
  }
  
  int row_exist[100]; //その行のマスに黒があるかの真偽値を入れる配列
  int col_exist[100]; //その列のマスに黒があるかの真偽値を入れる配列

  
  for(int i = 0;i < height;i++){
    for(int j = 0;j < width;j++){
      scanf(" %c",&grid[i][j]); //(i,j)の配色を入力
      if(grid[i][j] == '#'){ //もし黒であれば、各真偽値を1とする
        row_exist[i]=1;
        col_exist[j]=1;
      }
    }
  }
  for(int i = 0;i < height;i++){
    if(row_exist[i] == 1 ){ //まず黒がある行について
      for(int j = 0;j < width;j++){
        if(col_exist[j] == 1){ //黒がある列であれば
          printf("%c",grid[i][j]); //配色を出力
        }
      }
      printf("\n"); //行ごとに改行
    }
  }
  //メモリ領域の解放（逆順）
  for(i = 0; i < height; i++){
          free(grid[i]);
  }
  free(grid);
  
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:20:3: error: '\U00005404\U0000884c\U0000306e\U00008981\U00007d20\U00005206\U0000306e\U000030e1\U000030e2\U000030ea\U00009818\U000057df\U00003092\U000078ba\U00004fdd' undeclared (first use in this function)
   20 |   各行の要素分のメモリ領域を確保
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:20:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:33: error: expected ';' before 'for'
   20 |   各行の要素分のメモリ領域を確保
      |                                 ^
      |                                 ;
   21 |   for(int i=0;i<height;i++){
      |   ~~~                            
main.c:37:9: error: 'row_exist' undeclared (first use in this function); did you mean 'col_exist'?
   37 |         row_exist[i]=1;
      |         ^~~~~~~~~
      |         col_exist
main.c:53:7: error: 'i' undeclared (first use in this function)
   53 |   for(i = 0; i < height; i++){
      |       ^
Language: C++

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

int main() {
  int H, W;
  cin >> H >> W;
  vector<char> vec(H*W);

  for (int i = 0; i < H*W; i++) {
      char a;
      cin >> a;
      vec.at(i) = a;
    }
  int h = 0, w = 0;
  for (int i = H-1; i >= 0; i--) {
    for (int j = W-1; j >= 0; j--) {
      if (vec.at(i*W + j) == '#')
        break;
      else if (vec.at(i*W + j) == '.' && j > 0)
        continue;
      for (int k = 0; k < W; k++)
        vec.erase(vec.begin() + i*W + (W-k-1));
      h--;
    }
  }
    
  for (int j = W-1; j >= 0; j--) {
    for (int i = H-h-1; i >= 0; i--) {
      if (vec.at(j + i*(W-w)) == '#')
        break;
      else if (vec.at(j + i*(W-w)) == '.' && i > 0)
        continue;
      for (int k = 0; k < H-h; k++)
        vec.erase(vec.begin() + j + k*(W-w));
      w--;
    }
  }
        
  for (int i = 0; i < H-h; i++) {
    for (int j = 0; j < W-w; j++) {
      if (j != W-w-1)
        cout << vec.at(i).at(j+i*(W-w));
      else if (j == W-w-1)
        cout << vec.at(i).at(j+i*(W-w)) << endl;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:27: error: request for member 'at' in 'vec.std::vector<char>::at(((std::vector<char>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   42 |         cout << vec.at(i).at(j+i*(W-w));
      |                           ^~
a.cc:44:27: error: request for member 'at' in 'vec.std::vector<char>::at(((std::vector<char>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   44 |         cout << vec.at(i).at(j+i*(W-w)) << endl;
      |                           ^~
Language: C++

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

int main() {
  int H, W;
  cin >> H >> W;
  vector<char> vec(H*W);

  for (int i = 0; i < H*W; i++) {
      char a;
      cin >> a;
      vec.at(i) = a;
    }
  int h = 0, w = 0;
  for (int i = H-1; i >= 0; i--) {
    for (int j = W-1; j >= 0; j--) {
      if (vec.at(i*W + j) == '#')
        break;
      else if (vec.at(i*W + j) == '.' && j > 0)
        continue;
      for (int k = 0; k < W; k++)
        vec.erase(vec.begin() + i*W + (W-k-1));
      h--;
    }
  }
    
  for (int j = W-1; j >= 0; j--) {
    for (int i = H-h-1; i >= 0; i--) {
      if (vec.at(j + i*(W-w)) == '#')
        break;
      else if (vec.at(j + i*(W-w)) == '.' && i > 0)
        continue;
      for (int k = 0; k < H-h; k++)
        vec.erase(vec.begin() + j + k*(W-w));
      w--;
    }
  }
        
  for (int i = 0; i < H-h; i++) {
    for (int j = 0; j < W-w; j++) {
      if (j != N-1)
        cout << vec.at(i).at(j+i*(W-w));
      else if (j == N-1)
        cout << vec.at(i).at(j+i*(W-w)) << endl;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:16: error: 'N' was not declared in this scope
   41 |       if (j != N-1)
      |                ^
a.cc:42:27: error: request for member 'at' in 'vec.std::vector<char>::at(((std::vector<char>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   42 |         cout << vec.at(i).at(j+i*(W-w));
      |                           ^~
a.cc:44:27: error: request for member 'at' in 'vec.std::vector<char>::at(((std::vector<char>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   44 |         cout << vec.at(i).at(j+i*(W-w)) << endl;
      |                           ^~
Language: C++

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

int main() {
  int H, W;
  cin >> H >> W;
  vector<char> vec(H*W);

  for (int i = 0; i < H*W; i++) {
      char a;
      cin >> a;
      vec.at(i) = a;
    }
  int h = 0, w = 0;
  for (int i = H-1; i >= 0; i--) {
    for (int j = W-1; j >= 0; j--) {
      if (vec.at(i*W + j) == '#')
        break;
      else if (vec.at(i*W + j) == '.' && j > 0)
        continue;
      for (int k = 0; k < W; k++)
        vec.erase(v.begin() + i*W + (W-k-1));
      h--;
    }
  }
    
  for (int j = W-1; j >= 0; j--) {
    for (int i = H-h-1; i >= 0; i--) {
      if (vec.at(j + i*(W-w)) == '#')
        break;
      else if (vec.at(j + i*(W-w)) == '.' && i > 0)
        continue;
      for (int k = 0; k < H-h; k++)
        vec.erase(v.begin() + j + k*(W-w));
      w--;
    }
  }
        
  for (int i = 0; i < H-h; i++) {
    for (int j = 0; j < W-w; j++) {
      if (j != N-1)
        cout << vec.at(i).at(j+i*(W-w));
      else if (j == N-1)
        cout << vec.at(i).at(j+i*(W-w)) << endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:19: error: 'v' was not declared in this scope
   22 |         vec.erase(v.begin() + i*W + (W-k-1));
      |                   ^
a.cc:34:19: error: 'v' was not declared in this scope
   34 |         vec.erase(v.begin() + j + k*(W-w));
      |                   ^
a.cc:41:16: error: 'N' was not declared in this scope
   41 |       if (j != N-1)
      |                ^
a.cc:42:27: error: request for member 'at' in 'vec.std::vector<char>::at(((std::vector<char>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   42 |         cout << vec.at(i).at(j+i*(W-w));
      |                           ^~
a.cc:44:27: error: request for member 'at' in 'vec.std::vector<char>::at(((std::vector<char>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   44 |         cout << vec.at(i).at(j+i*(W-w)) << endl;
      |                           ^~
Language: C++

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

int main() {
  int H, W;
  cin >> H >> W;
  vector<char> vec(H*W);

  for (int i = 0; i < H*W; i++) {
      char a;
      cin >> a;
      vec.at(i) = a;
    }
  }
  int h = 0, w = 0;

  for (int i = H-1; i >= 0; i--) {
    for (int j = W-1; j >= 0; j--) {
      if (vec.at(i*W + j) == '#')
        break;
      else if (vec.at(i*W + j) == '.' && j > 0)
        continue;
      for (int k = 0; k < W; k++)
        vec.erase(i*W + (W-k-1));
      h--;
    }
  }
    
  for (int j = W-1; j >= 0; j--) {
    for (int i = H-h-1; i >= 0; i--) {
      if (vec.at(j + i*(W-w)) == '#')
        break;
      else if (vec.at(j + i*(W-w)) == '.' && i > 0)
        continue;
      for (int k = 0; k < H-h; k++)
        vec.erase(j + k*(W-w));
      w--;
    }
  }
        
  for (int i = 0; i < H-h; i++) {
    for (int j = 0; j < W-w; j++) {
      if (j != N-1)
        cout << vec.at(i).at(j+i*(W-w));
      else if (j == N-1)
        cout << vec.at(i).at(j+i*(W-w)) << endl;
    }
  }
}


Compiler output:
a.cc:17:3: error: expected unqualified-id before 'for'
   17 |   for (int i = H-1; i >= 0; i--) {
      |   ^~~
a.cc:17:21: error: 'i' does not name a type
   17 |   for (int i = H-1; i >= 0; i--) {
      |                     ^
a.cc:17:29: error: 'i' does not name a type
   17 |   for (int i = H-1; i >= 0; i--) {
      |                             ^
a.cc:29:3: error: expected unqualified-id before 'for'
   29 |   for (int j = W-1; j >= 0; j--) {
      |   ^~~
a.cc:29:21: error: 'j' does not name a type
   29 |   for (int j = W-1; j >= 0; j--) {
      |                     ^
a.cc:29:29: error: 'j' does not name a type
   29 |   for (int j = W-1; j >= 0; j--) {
      |                             ^
a.cc:41:3: error: expected unqualified-id before 'for'
   41 |   for (int i = 0; i < H-h; i++) {
      |   ^~~
a.cc:41:19: error: 'i' does not name a type
   41 |   for (int i = 0; i < H-h; i++) {
      |                   ^
a.cc:41:28: error: 'i' does not name a type
   41 |   for (int i = 0; i < H-h; i++) {
      |                            ^
a.cc:49:1: error: expected declaration before '}' token
   49 | }
      | ^
Language: C++

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

int main() {
  int H, W;
  cin >> H >> W;
  vector<char> vec(H*W);

  for (int i = 0; i < H*W; i++) {
      char a;
      cin >> a;
      vec.at(i) = a;
    }
  }
  int h = 0, w = 0;
  for (int i = H-1; i >= 0; i--) {
    for (int j = W-1; j >= 0; j--) {
      if (vec.at(i*W + j) == '#')
        break;
      else if (vec.at(i*W + j) == '.' && j > 0)
        continue;
      for (int k = 0; k < W; k++)
        vec.erase(i*W + (W-k-1));
      h--;
    }
  }
    
  for (int j = W-1; j >= 0; j--) {
    for (int i = H-h-1; i >= 0; i--) {
      if (vec.at(j + i*(W-w)) == '#')
        break;
      else if (vec.at(j + i*(W-w)) == '.' && i > 0)
        continue;
      for (int k = 0; k < H-h; k++)
        vec.erase(j + k*(W-w));
      w--;
    }
  }
        
  for (int i = 0; i < H-h; i++) {
    for (int j = 0; j < W-w; j++) {
      if (j != N-1)
        cout << vec.at(i).at(j+i*(W-w));
      else if (j == N-1)
        cout << vec.at(i).at(j+i*(W-w)) << endl;
    }
  }
}


Compiler output:
a.cc:16:3: error: expected unqualified-id before 'for'
   16 |   for (int i = H-1; i >= 0; i--) {
      |   ^~~
a.cc:16:21: error: 'i' does not name a type
   16 |   for (int i = H-1; i >= 0; i--) {
      |                     ^
a.cc:16:29: error: 'i' does not name a type
   16 |   for (int i = H-1; i >= 0; i--) {
      |                             ^
a.cc:28:3: error: expected unqualified-id before 'for'
   28 |   for (int j = W-1; j >= 0; j--) {
      |   ^~~
a.cc:28:21: error: 'j' does not name a type
   28 |   for (int j = W-1; j >= 0; j--) {
      |                     ^
a.cc:28:29: error: 'j' does not name a type
   28 |   for (int j = W-1; j >= 0; j--) {
      |                             ^
a.cc:40:3: error: expected unqualified-id before 'for'
   40 |   for (int i = 0; i < H-h; i++) {
      |   ^~~
a.cc:40:19: error: 'i' does not name a type
   40 |   for (int i = 0; i < H-h; i++) {
      |                   ^
a.cc:40:28: error: 'i' does not name a type
   40 |   for (int i = 0; i < H-h; i++) {
      |                            ^
a.cc:48:1: error: expected declaration before '}' token
   48 | }
      | ^
Language: C++

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

int main() {
  int H, W;
  cin >> H >> W;
  vector<char> vec(H*W);

  for (int i = 0; i < H*W; i++) {
      char a;
      cin >> a;
      vec.at(i) = a;
    }
  }
  int h = 0, w = 0;
  for (int i = H-1; i >= 0; i--) {
    for (int j = W-1; j >= 0; j--) {
      if (vec.at(i*W + j) == '#')
        break;
      else if (vec.at(i*W + j) == '.' && j > 0)
        continue;
      for (int k = 0; k < W; k++)
        vec.erase(i*W + (W-k-1));
      h--;
    }
    
  for (int j = W-1; j >= 0; j--) {
    for (int i = H-h-1; i >= 0; i--) {
      if (vec.at(j + i*(W-w)) == '#')
        break;
      else if (vec.at(j + i*(W-w)) == '.' && i > 0)
        continue;
      for (int k = 0; k < H-h; k++)
        vec.erase(j + k*(W-w));
      w--;
    }
        
  for (int i = 0; i < H-h; i++) {
    for (int j = 0; j < W-w; j++) {
      if (j != N-1)
        cout << vec.at(i).at(j+i*(W-w));
      else if (j == N-1)
        cout << vec.at(i).at(j+i*(W-w)) << endl;
    }
  }
}


Compiler output:
a.cc:16:3: error: expected unqualified-id before 'for'
   16 |   for (int i = H-1; i >= 0; i--) {
      |   ^~~
a.cc:16:21: error: 'i' does not name a type
   16 |   for (int i = H-1; i >= 0; i--) {
      |                     ^
a.cc:16:29: error: 'i' does not name a type
   16 |   for (int i = H-1; i >= 0; i--) {
      |                             ^
Language: C++

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

int main() {
  int H, W;
  cin >> H >> W;
  vector<vector<char>> masu(H,vector<char>(W));
  
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      cin >> masu.at(i).at(j);
    }
  }
  
  for(int i=0;i<H;i++){
    int j=0;
    while(masu.at(i).at(j) == '.'){
      if(j == W-1){
        for(int k=i;k<H-1;k++){
          for(int l=0;l<W;l++){
            masu.at(k).at(l) = masu.at(k+1).at(l);
          }
        }
        H--;
      }else{
        j++;
      }
    }
  }
  for(int i=0;i<w;i++){
    int j=0;
    while(masu.at(i).at(j) == '.'){
      if(j == H-1){
        for(int k=i;k<W-1;k++){
          for(int l=0;l<H;l++){
            masu.at(k).at(l) = masu.at(k+1).at(l);
          }
        }
        W--;
      }else{
        j++;
      }
    }
  }
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      cout << masu.at(i).at(j);
    }
    cout << endl;
  }
}


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

#define rep(i, n) for (int i = 0; i < (n); i++)
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int MOD = 1000000007;
// MAX int 2,147,483,647
// MAX O(n) 10^18

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);
        }
    }

    vector<bool> row(H, false);
    vector<bool> col(W, false);

    rep(i, H) {
        rep(j, W) {
            if (a.at(i).at(j) == '#') {
                row.at(i) = true;
                col.at(j) = true;
            }
        }
    }

    rep(i, H) {
        rep(j, W) {
            if(row.at(i) == true && col.at(j) == true) {
                cout << a.at(i).at(j);
            }
        }
        if(row.at(i) == true) cout << endl;
    }
  	cout << "hoge"

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:23: error: expected ';' before 'return'
   40 |         cout << "hoge"
      |                       ^
      |                       ;
   41 | 
   42 |     return 0;
      |     ~~~~~~
Language: C++

int main() {
  // Declare values
  int H, W; cin >> H >> W;
  vector<vector<char>> table(H, vector<char>(W));
  // input
  rep(i, H) {
    rep(j, W) {
      cin >> table.at(i).at(j); 
    }
  }
 
  // Checkpoint
  vector<bool> line(H, false);
  vector<bool> quene(W, false);
 
  rep(i, H) {
    rep(j, W) {
      if (table.at(i).at(j) == '#') {
        line.at(i) = true;
        quene.at(j) = true;
      }
    }
  }
 
 
  rep(i, H) {
    if (line.at(i)){
      rep(j, W) {
        if (quene.at(j)) {
          cout << table.at(i).at(j);
        }
      }
      cout << endl;
    }
  }
  
  return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:13: error: 'cin' was not declared in this scope
    3 |   int H, W; cin >> H >> W;
      |             ^~~
a.cc:4:3: error: 'vector' was not declared in this scope
    4 |   vector<vector<char>> table(H, vector<char>(W));
      |   ^~~~~~
a.cc:4:17: error: expected primary-expression before 'char'
    4 |   vector<vector<char>> table(H, vector<char>(W));
      |                 ^~~~
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) {
      |   ^~~
a.cc:13:10: error: expected primary-expression before 'bool'
   13 |   vector<bool> line(H, false);
      |          ^~~~
a.cc:14:10: error: expected primary-expression before 'bool'
   14 |   vector<bool> quene(W, false);
      |          ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int H,W;
  cin >> H >> W;
  
  int i,j;
  vector<vector<char>> a(H, vector<char>(W));

  for(i=0;i<H;i++){
    for(j=0;j<W;j++){
      cin >> a.at(i).at(j);
    }
  }
  
  vector<bool> row(H,false);
  vector<bool> col(W,false);

  for(i=0;i<H;i++){
    for(j=0;j<W;j++){
      if(a.at(i).at(j) == '#'){
        row.at(i) = true;
        col.at(j) = true;
      }
    }
  }

  for(i=0;i<H;i++){
    if(row.at(i)){
        for(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:38:4: error: expected '}' at end of input
   38 |   }
      |    ^
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,vecotr<char>(W));
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      cin >> table.at(i).at(j);
    }
  }
  
  vector<bool> flagH(H,false);
  vector<bool> flagW(W,false);
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      if(table.at(i).at(j)=='#'){
        flagH.at(i)=true;
        flagW.at(j)=true;
      }
    }
  }
  
    for(int i=0;i<H;i++){
  	  for(int j=0;j<W;j++){
        if(flagH.at(i)&&flagW.at(j))
          cout << table.at(i).at(j);
        if(j=W-1)
          cout << endl;
      }
    }
   
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:32: error: 'vecotr' was not declared in this scope
    8 |   vector<vector<char>> table(H,vecotr<char>(W));
      |                                ^~~~~~
a.cc:8:39: error: expected primary-expression before 'char'
    8 |   vector<vector<char>> table(H,vecotr<char>(W));
      |                                       ^~~~
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(table.at(i).at(j)=='#'){
          row.at(i)=true;
          col.at(j)=true;
        }
      }
  }
  for(int i=0;i<H;i++){
    if(row.at(i)){
      for(int j=0;j<W;j++){
        if(col.at(j)){
          cout << table.at(i).at(j);
        }
      }
    }
    cout << endl;
  }
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: expected ',' or ';' before 'for'
    8 |     for(int i=0;i < H;i++){
      |     ^~~
a.cc:8:17: error: 'i' was not declared in this scope
    8 |     for(int i=0;i < H;i++){
      |                 ^
a.cc:15:3: error: expected ',' or ';' before 'vector'
   15 |   vector<bool> col(W,false)
      |   ^~~~~~
a.cc:27:12: error: 'col' was not declared in this scope; did you mean 'cosl'?
   27 |         if(col.at(j)){
      |            ^~~
      |            cosl
Language: C

/*  ex5_3
    potter0723sw  */

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

int main(void){
    int height, width, i, j, rowblack[100]={0}, colblack[100]={0};
    char cell[100][100];
    scanf("%d %d", &height, &width);

    for(i=0; i < height; i++){//マスの入力を受け取る
        for(j=0; j < width; j++){
            scanf(" %c", &cell[i][j]);
        }
    }

    for(i=0; i < height; i++){//黒マスのある行や列を記憶
        for(j=0; j < width; j++){
            if(cell[i][j] == '#'){
                rowblack[i] = 1;
                colblack[j] = 1;
            }
        }
    }

    for(i=0; i < height; i++){同じ行にも列にも黒マスのあるマスのみ出力
        if(rowblack[i]==1){
            for(j=0; j < width; j++){
                if(colblack[j] == 1){
                    printf("%c", cell[i][j]);
                }
            }
        }
    printf("\n");
    }
}


Compiler output:
main.c: In function 'main':
main.c:27:31: error: '\U0000540c\U00003058\U0000884c\U0000306b\U00003082\U00005217\U0000306b\U00003082\U00009ed2\U000030de\U000030b9\U0000306e\U00003042\U0000308b\U000030de\U000030b9\U0000306e\U0000307f\U000051fa\U0000529b' undeclared (first use in this function)
   27 |     for(i=0; i < height; i++){同じ行にも列にも黒マスのあるマスのみ出力
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:27:31: note: each undeclared identifier is reported only once for each function it appears in
main.c:27:71: error: expected ';' before 'if'
   27 |     for(i=0; i < height; i++){同じ行にも列にも黒マスのあるマスのみ出力
      |                                                                       ^
      |                                                                       ;
   28 |         if(rowblack[i]==1){
      |         ~~
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 h = 0; h < H; h++) {
    for(int w = 0; w < W; w++) {
      cin >> table.at(h).at(w);
    }
  }
  
  vector<int> line;
  vector<int> row;
  
  for (int h = 0; h < H; h++) {
    for(int w = 0; w < W; w++) {
      if(table.at(h).at(w) == '#'){
        line.push_back(h);
        row.push_back(w);
        break;
      }
    }
  }
  
  for (int h = 0; h < H; h++) {
    for (int i : ine) {
      if (h == i) { 
        
    	for(int w = 0; w < W; w++) {
	      for (int j : del_row) {
        	if (w == j) {
      		  cout << table.at(h).at(w);
            }
          }
        }
        cout << endl;
      }
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:18: error: 'ine' was not declared in this scope; did you mean 'line'?
   30 |     for (int i : ine) {
      |                  ^~~
      |                  line
a.cc:34:28: error: 'del_row' was not declared in this scope
   34 |               for (int j : del_row) {
      |                            ^~~~~~~
Language: C

#include <stdio.h>
int main(void){
  int row,column,i,j,rblack[100],cblack[100];//rblack,cblack各行・列の＃数を数える配列
  char matrix[100][100];
  scanf("%d %d",&row,&column);//行数、列数を入力
  rblack[100] = {0};//
  cblack[100] = {0};//
  for(i=0;i<row;i++){//
    for(j=0;j<column;j++){
      scanf(" %c",&matrix[i][j]);//
      if(matrix[i][j] == '#'){//
        rblack[i] += 1;//
        cblack[j] += 1;//
      }
    }
  }
  for(i=0;i<row;i++){//
    for(j=0;j<column;j++){
      if(rblack[i] != 0 && cblack[j] != 0){//
        printf("%c",matrix[i][j]);//
      }
    }
    if(rblack != 0){//
      printf("\n");//
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:17: error: expected expression before '{' token
    6 |   rblack[100] = {0};//
      |                 ^
main.c:7:17: error: expected expression before '{' token
    7 |   cblack[100] = {0};//
      |                 ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define REP1(i,n) for(int i=1, i##_len=(n); i<i##_len; ++i)
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define pow(x) x*x
#define ll long long

static const ll MAX = 1000000;
static const ll INFTY = 1e12;
static const ll MOD = 1000000007;

template < typename T > inline string toString( const T &a ) { ostringstream oss; oss << a; return oss.str(); };

struct edge {
    ll to, cost;
};

using Graph = vector<vector<int>>;
using _Graph = vector<vector<edge>>;


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

// 深さ優先探索
vector<bool> seen;
vector<int> colors;

int H, W, N;
int sx, sy, gx, gy; 
vector<vector<char>> field;
vector<vector<int>> dist;
//vector<pair<int, int>> gx, gy;
deque<pair<int, int>> que;

typedef vector<vector<int> > Matrix;

const ll INF = 1e18;


int main() {

    int H, W;
    cin >> H >> W;
    int Hcount = 0;
    int Vcount = 0;
    vector<vector<char>> a(H+10, vector<char>('0', W+10));
    REP(i, H)REP(j, W)cin >> a[i][j];
    vector<int> trueH(H+10, 0), trueW(W+10, 0);

	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: In function 'int main()':
a.cc:53:26: error: 'h' was not declared in this scope
   53 |         vector<bool> row(h, false);
      |                          ^
a.cc:54:26: error: 'w' was not declared in this scope
   54 |         vector<bool> col(w, false);
      |                          ^
Language: C

/*  ex5_3
    potter0723sw  */

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

int main(void){
    int height, width, i, j, rowblack[100], colblack[100];
    char cell[100][100];
    scanf("%d %d", &height, &width);

    for(i=0;i<100;i++){
      rowblack[i]=0;
      colblack[i]=0;
    }

    for(i=0; i < height; i++){//マスの入力を受け取る
        for(j=0; j < width; j++){
            scanf("　%c", &cell[i][j]);
        }
    }

    for(i=0; i < height; i++){
        for(j=0; j < width; j++){
            if(cell[i][j] == '#'){
                rowblack[i] = 1;
                colblack[j] = 1;
            }
        }
    }
    
    for(i=0; i < height; i++){
        if(rowblack[i]==1){
            for(j=0; j < width; j++){
                if(colblack[j] == 1){
                    printf("%c", cell[i][j]);
                }
            }
        printf("\n");
        }
    }
}
v

Compiler output:
main.c:43:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
   43 | v
      | ^
Language: C

/*  ex5_3
    potter0723sw  */

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

int main(void){
    int height, width, i, j, rowblack[100], colblack[100];
    char cell[100][100];
    scanf("%d %d", &height, &width);

    for(i=0;i<100;1++){
      rowblack[i]=0;
      colblack[i]=0;
    }

    for(i=0; i < height; i++){//マスの入力を受け取る
        for(j=0; j < width; j++){
            scanf("　%c", &cell[i][j]);
        }
    }

    for(i=0; i < height; i++){
        for(j=0; j < width; j++){
            if(cell[i][j] == '#'){
                rowblack[i] = 1;
                colblack[j] = 1;
            }
        }
    }
    
    for(i=0; i < height; i++){
        if(rowblack[i]==1){
            for(j=0; j < width; j++){
                if(colblack[j] == 1){
                    printf("%c", cell[i][j]);
                }
            }
        printf("\n");
        }
    }
}


Compiler output:
main.c: In function 'main':
main.c:12:20: error: lvalue required as increment operand
   12 |     for(i=0;i<100;1++){
      |                    ^~
Language: C

/*  ex5_3
    potter0723sw  */

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

int main(void){
    int height, width, i, j, rowblack[100], colblack[100];
    char cell[100][100];
    scanf("%d %d", &height, &width);

    for(i=0;i<100;1++){
      rowblack[i]=0
      colblack[i]=0
    }

    for(i=0; i < height; i++){//マスの入力を受け取る
        for(j=0; j < width; j++){
            scanf("　%c", &cell[i][j]);
        }
    }

    for(i=0; i < height; i++){
        for(j=0; j < width; j++){
            if(cell[i][j] == '#'){
                rowblack[i] = 1;
                colblack[j] = 1;
            }
        }
    }
    
    for(i=0; i < height; i++){
        if(rowblack[i]==1){
            for(j=0; j < width; j++){
                if(colblack[j] == 1){
                    printf("%c", cell[i][j]);
                }
            }
        printf("\n");
        }
    }
}


Compiler output:
main.c: In function 'main':
main.c:12:20: error: lvalue required as increment operand
   12 |     for(i=0;i<100;1++){
      |                    ^~
main.c:13:20: error: expected ';' before 'colblack'
   13 |       rowblack[i]=0
      |                    ^
      |                    ;
   14 |       colblack[i]=0
      |       ~~~~~~~~
Language: C

z/*  ex5_3
    potter0723sw  */

#include <stdio.h>

int main(void){
    int height, width, i, j, rowblack[100]={0}, colblack[100]={0};
    char cell[100][100];
    scanf("%d %d", &height, &width);

    for(i=0; i < height; i++){//マスの入力を受け取る
        for(j=0; j < width; j++){
            scanf("　%c", &cell[i][j]);
        }
    }

    for(i=0; i < height; i++){
        for(j=0; j < width; j++){
            if(cell[i][j] == '#'){
                rowblack[i] = 1;
            }
        }
    }

    for(j=0; j < width; j++){
        for(i=0; i < height; i++){
            if(cell[i][j] == '#'){
                colblack[j] = 1;
            }
        }
    }

    for(i=0; i < height; i++){
        if(rowblack[i]==1){
            for(j=0; j < width; j++){
                if(colblack[j] == 1){
                    printf("%c", cell[i][j]);
                }
            }
        }
    printf("\n");
    }
    return 0;
}

Compiler output:
main.c:1:2: error: expected ';' before 'typedef'
    1 | z/*  ex5_3
      |  ^
      |  ;
Language: C

z/*  ex5_3
    potter0723sw  */

#include <stdio.h>

int main(void){
    int height, width, i, j, rowblack[100]={0}, colblack[100]={0};
    char cell[100][100];
    scanf("%d %d", &height, &width);

    for(i=0; i < height; i++){//マスの入力を受け取る
        for(j=0; j < width; j++){
            scanf("　%c", &cell[i][j]);
        }
    }

    for(i=0; i < height; i++){
        for(j=0; j < width; j++){
            if(cell[i][j] == '#'){
                rowblack[i] = 1;
            }
        }
    }

    for(j=0; j < width; j++){
        for(i=0; i < height; i++){
            if(cell[i][j] == '#'){
                colblack[j] = 1;
            }
        }
    }

    for(i=0; i < height; i++){
        if(rowblack[i]==1){
            for(j=0; j < width; j++){
                if(colblack[j] == 1){
                    printf("%c", cell[i][j]);
                }
            }
        }
    printf("\n");
    }
    return 0
}


Compiler output:
main.c:1:2: error: expected ';' before 'typedef'
    1 | z/*  ex5_3
      |  ^
      |  ;
main.c: In function 'main':
main.c:43:13: error: expected ';' before '}' token
   43 |     return 0
      |             ^
      |             ;
   44 | }
      | ~
Language: C

/*  ex5_3
    potter0723sw  */

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

int main(void){
    int height, width, i, j, rowblack[100]={0}, colblack[100]={0};
    char cell[100][100];
    scanf("%d %d", &height, &width);

    for(i=0; i < height; i++){//マスの入力を受け取る
        for(j=0; j < width; j++){
            scanf("　%c", &cell[i][j]);
        }
    }

    for(i=0; i < height; i++){
        for(j=0; j < width; j++){
            if(cell[i][j] == '#'){
                rowblack[i] = 1;
            }
        }
    }

    for(j=0; j < width; j++){
        for(i=0; i < height; i++){
            if(cell[i][j] == '#'){
                colblack[j] = 1;
            }
        }
    }

    for(i=0; i < height; i++){
        if(rowblack[i]==1){
            for(j=0; j < width; j++){
                if(colblack[j] == 1){
                    printf("%c", cell[i][j]);
                }
            }
        }
    printf("\n");
    }
    return 0
}


Compiler output:
main.c: In function 'main':
main.c:44:13: error: expected ';' before '}' token
   44 |     return 0
      |             ^
      |             ;
   45 | }
      | ~
Language: C

/*Kadai5_3
 saitomo*/
#include <stdio.h>
int main(void){
    int row,col,i,j;   
    scanf("%d %d", &row, &col);
    int count_row[row],count_col[col];//行と列での＃の出現の判定に使う
    char box[row][col];//マス目を読み込む
    for(i=0;i<row;i++){
        for(j=0;j<col;j++){
            scanf(" %c",&box[i][j]);
            count_row[i]=0;//値の初期化
            count_col[j]=0;
        }
    }
  　for(i=0;i<row;i++){
        for(j=0;j<col;j++){
            if(box[i][j]=='#'){
                count_row[i]=1;//行または列に＃が存在すれば1となる
                count_col[j]=1;
            }
        }
    }
    for(i=0;i<row;i++){
        if(count_row[i]==1){//行中に＃があるか判定
            for(j=0;j<col;j++){
                 if(count_col[j]){//列中に＃があるか判定
                      printf("%c",box[i][j]);//消えない部分をプリントする
                 }
            }
            printf("\n");//1行ごとに改行
        }
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:16:3: error: stray '\343' in program
   16 |   <U+3000>for(i=0;i<row;i++){
      |   ^~~~~~~~
Language: C

/*Kadai5_3
 saitomo*/
#include <stdio.h>
int main(void){
    int row,col,i,j;   
    scanf("%d %d", &row, &col);
    int count_row[row],count_col[col];//行と列での＃の出現の判定に使う
    char box[row][col];//マス目を読み込む
    for(i=0;i<row;i++){
        for(j=0;j<col;j++){
            scanf(" %c",&box[i][j]);
            count_row[i]=0;//値の初期化
            count_col[j]=0;
        }
    }
  　for(i=0;i<row;i++){
        for(j=0;j<col;j++){
            if(box[i][j]=='#'){
                count_row[i]=1;//行または列に＃が存在すれば1となる
                count_col[j]=1;
            }
        }
    }
    for(i=0;i<row;i++){
        if(count_row[i]==1){//行中に＃があるか判定
            for(j=0;j<col;j++){
                 if(count_col[j]){//列中に＃があるか判定
                      printf("%c",box[i][j]);//消えない部分をプリントする
                 }
            }
        printf("\n");//1行ごとに改行
        }
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:16:3: error: stray '\343' in program
   16 |   <U+3000>for(i=0;i<row;i++){
      |   ^~~~~~~~