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

#include <bits/stdc++.h>
using namespace std;
int main(){
  int H,W;
  cin >>H>>W;
  string board[50];
  for(int i = 0;i<H;i++){
    cin>>board[i];
  }
  int dx[8] = {1,0,-1,0,1,-1,-1,1};
  int dy[8] = {0,1,0,-1,1,1,-1,-1};
  
  for(int i = 0;i<H;i++){
    for(int j = 0;i<W;i++){
      if(board[i][j] = '#'){continue;}
      int num = 0;
      for(int d = 0;d<8;d++){
        int ni = i + dx[d];
        int nj = j + dy[d];
        
        if(ni < 0 || H < ni){continue;}
        if(nj < 0 || W < nj){continue;}
        
        if(board[ni][nj] = '#' ){num++;}
        
      }
      board[i][j] = char(num + '0')
    }
  }
  
  for (int i = 0;i<H;i++){
    cout << broad[i] << endl;
  }
  return 0;
}
      
  


Compiler output:
a.cc: In function 'int main()':
a.cc:27:36: error: expected ';' before '}' token
   27 |       board[i][j] = char(num + '0')
      |                                    ^
      |                                    ;
   28 |     }
      |     ~                               
a.cc:32:13: error: 'broad' was not declared in this scope
   32 |     cout << broad[i] << endl;
      |             ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int H,W;
  cin >>H>>W;
  string board[50];
  for(int i = 0;i<H;i++){
    cin>>board[i];
  }
  int dx[8] = {1,0,-1,0,1,-1,-1,1}
  int dy[8] = {0,1,0,-1,1,1,-1,-1}
  
  for(int i = 0;i<H;i++){
    for(int j = 0;i<W;i++){
      if(board[i][j] = '#'){continue;}
      int num = 0;
      for(int d = 0;d<8;d++){
        int ni = i + dx[d];
        int nj = j + dy[d];
        
        if(ni < 0 || H < ni){continue;}
        if(nj < 0 || W < nj){continue;}
        
        if(board[ni][nj] = '#' ){num++;}
        
      }
      board[i][j] = char(num + '0')
    }
  }
  
  for (int i = 0;i<H;i++){
    cout << broad[i] << endl;
  }
  return 0;
}
      
  

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: expected ',' or ';' before 'int'
   11 |   int dy[8] = {0,1,0,-1,1,1,-1,-1}
      |   ^~~
a.cc:19:22: error: 'dy' was not declared in this scope; did you mean 'd'?
   19 |         int nj = j + dy[d];
      |                      ^~
      |                      d
a.cc:27:36: error: expected ';' before '}' token
   27 |       board[i][j] = char(num + '0')
      |                                    ^
      |                                    ;
   28 |     }
      |     ~                               
a.cc:32:13: error: 'broad' was not declared in this scope
   32 |     cout << broad[i] << endl;
      |             ^~~~~
Language: C++

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

int main(){
  int n,m,c=0;
  cin>>n>>m;
  char a[50][50];
  for(int i=0;i<n;i++){
    for(int j=0;j<m;j++){
      cin>>a[i][j];
    }
  }
  for(int i=0;i<n;i++){
    for(int j=0;j<m;j++){
      if(a[i][j]=='#'){
        cout<<"#";
        continue;
      }
      c=0;
      if(i>=1&&j>=1){
      c+=(a[i-1][j-1]=='#');
      }
      if(j>=1){
      c+=(a[i][j-1]=='#');
        if(i<49){
      c+=(a[i+1][j-1]=='#');
        }
      }
      if(i>=1){
      c+=(a[i-1][j]=='#');
      }
      if(i<49){
      c+=(a[i+1][j]=='#');
      }
      if(j<49){
        if(i<49){
      c+=(a[i+1][j+1]=='#');
        }
      c+=(a[i][j+1]=='#');
        if(i>=1){
      c+=(a[i-1][j+1]=='#');
        }
      cout<<c;
    }
    cout<<endl;
  }
}

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

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

int main(){
  int n,m,c=0;
  cin>>n>>m;
  char a[50][50];
  for(int i=0;i<n;i++){
    for(int j=0;j<m;j++){
      cin>>a[i][j];
    }
  }
  for(int i=0;i<n;i++){
    for(int j=0;j<m;j++){
      c=0;
      if(a[i][j]=='#'){
        cout<<"#"
        continue;
      }
      c+=(a[i-1][j-1]=='#');
      c+=(a[i][j-1]=='#');
      c+=(a[i+1][j-1]=='#');
      c+=(a[i-1][j]=='#');
      c+=(a[i+1][j]=='#');
      c+=(a[i+1][j+1]=='#');
      c+=(a[i][j+1]=='#');
      c+=(a[i-1][j+1]=='#');
      cout<<c;
    }
    cout<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:18: error: expected ';' before 'continue'
   17 |         cout<<"#"
      |                  ^
      |                  ;
   18 |         continue;
      |         ~~~~~~~~
Language: C++

include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main()
{char c[101][101]={0,0};
 char a[101][101]={0,0};
 int n,m,s;
 cin>>n>>m;
 for(int i=1;i<=n;i++)
    {for(int j=1;j<=m;j++)
        cin>>c[i][j]; 
	}
 for(int i=1;i<=n;i++)
    {for(int j=1;j<=m;j++)
        {if(c[i][j]=='#')
           cout<<'#';
		 else
		   {s=0;
		    if(c[i-1][j-1]=='#')
              s++;
            if(c[i-1][j]=='#')
              s++;
            if(c[i-1][j+1]=='#')
              s++;
            if(c[i][j-1]=='#')
              s++;
            if(c[i][j+1]=='#')
              s++;
            if(c[i+1][j-1]=='#')
              s++;
            if(c[i+1][j]=='#')
              s++;
            if(c[i+1][j+1]=='#')
              s++;
            cout<<s;
           } 
		}
	 cout<<endl;
    }
} 

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:9:2: error: 'cin' was not declared in this scope
    9 |  cin>>n>>m;
      |  ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include<cstring>
  +++ |+#include <iostream>
    4 | using namespace std;
a.cc:17:12: error: 'cout' was not declared in this scope
   17 |            cout<<'#';
      |            ^~~~
a.cc:17:12: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:36:13: error: 'cout' was not declared in this scope
   36 |             cout<<s;
      |             ^~~~
a.cc:36:13: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:39:10: error: 'cout' was not declared in this scope
   39 |          cout<<endl;
      |          ^~~~
a.cc:39:10: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:39:16: error: 'endl' was not declared in this scope
   39 |          cout<<endl;
      |                ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include<cstring>
  +++ |+#include <ostream>
    4 | using namespace std;
Language: C++

#include <iostream>
using namespace std;
int main(void){
    int h,w;
    cin >> h >> w;
    
    string s[50];
    for(int i = 0;i < h;i++) cin >> s[i];
    
    int dx[8] = {1,1,1,0,0,-1,-1,-1};
    int dy[8] = {0,1,-1,1,-1,0,1,-1};
    
    for(int i = 0;i < h;i++){
        for(int j = 0;j < w;j++){
            if(string[i][j] == '#') continue;
            
            int num = 0;
            for(int k = 0;k < 8;k++){
                int ny = i + dx[k];
                int nj = j + dy[k];
                
                if(ni < 0 || h <= ni) continue;
                if(nj < 0 || w <= nj) continue;
                if(s[i][j] == '#') num++;
            }
            s[i][j] = char(num + '0');
        }
    }
    for(int i = 0;i < h;i++) cout << s[i] << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:22: error: expected unqualified-id before '[' token
   15 |             if(string[i][j] == '#') continue;
      |                      ^
a.cc:22:20: error: 'ni' was not declared in this scope; did you mean 'nj'?
   22 |                 if(ni < 0 || h <= ni) continue;
      |                    ^~
      |                    nj
Language: C++

#include <bits/stdc++.h>
​
using namespace std;
​
int main() {
 int W,H;
 cin >> H >> W;
 char field[60][60];
 int count = 0;
 int dx[8] = { 1, 1, 0, -1, -1, -1, 0, 1 };
 int dy[8] = { 0, -1, -1, -1, 0, 1, 1, 1 };
 // 入力
 for (int y = 0; y < H; y++) {
  for (int x = 0; x < W; x++) {
   scanf(" %c",&field[x][y]);
  }
 }
​
 // 解く
 for (int y = 0; y < H; y++) {
  for (int x = 0; x < W; x++) {
   if(field[x][y] == '.') {
    count = 0;
    for (int i = 0; i < 8; i++) {
     if (x + dx[i] >= 0 && y + dy[i] >= 0 && x + dx[i] < W && y + dy[i] < H ) {
      if(field[x + dx[i]][y + dy[i]] == '#') {
       count++;
      }
     }
    }
    field[x][y] = '0' + count;
   }
  }
 }
​
 // 出力
 for (int y = 0; y < H; y++) {
  for (int x = 0; x < W; x++) {
   printf("%c",field[x][y]);
  }
  printf("\n");
 }

 return 0;
}


Compiler output:
a.cc:2:1: error: '\U0000200b' does not name a type
    2 | ​
      |  
a.cc:4:1: error: '\U0000200b' does not name a type
    4 | ​
      |
Language: C++

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

const int oo=-10;
char c;

int main()
{
    cin>>n>>m;
    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++)
        {
            cin>>c;
            if(c=='#')
            {
                a[i][j]=oo;
                a[i-1][j-1]++;
                a[i-1][j]++;
                a[i-1][j+1]++;
                a[i][j-1]++;
                a[i][j+1]++;
                a[i+1][j-1]++;
                a[i+1][j]++;
                a[i+1][j+1]++;
            }
        }
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=m;j++)
            if(a[i][j]<0)cout<<"#";
            else cout<<a[i][j];
        cout<<endl；
    }   
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: 'n' was not declared in this scope; did you mean 'yn'?
    9 |     cin>>n>>m;
      |          ^
      |          yn
a.cc:9:13: error: 'm' was not declared in this scope; did you mean 'tm'?
    9 |     cin>>n>>m;
      |             ^
      |             tm
a.cc:16:17: error: 'a' was not declared in this scope
   16 |                 a[i][j]=oo;
      |                 ^
a.cc:30:16: error: 'a' was not declared in this scope
   30 |             if(a[i][j]<0)cout<<"#";
      |                ^
a.cc:32:15: error: 'endl\U0000ff1b' was not declared in this scope
   32 |         cout<<endl；
      |               ^~~~~~
Language: C++

#include<cstdio>
char a[60][60];int js[60][60];
int main()
{
    int n,m;
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++)
    {
        scanf("%s",a[i]);
    }
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=m;j++)
        {
            if(a[i+1][j]=='#'||a[i+1][j+1]=='#'||a[i-1][j-1]=='#'||a[i-1][j]='#'||a[i-1][j+1]=='#'||a[i+1][j-1]=='#'||a[i][j+1]=='#'||a[i][j-1]=='#')js[i][j]++;
        }
    }
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=m;j++)
        {
             if(a[i][j]=='.')printf("%d",js[i][j]);
             else printf("#");
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:66: error: lvalue required as left operand of assignment
   15 |             if(a[i+1][j]=='#'||a[i+1][j+1]=='#'||a[i-1][j-1]=='#'||a[i-1][j]='#'||a[i-1][j+1]=='#'||a[i+1][j-1]=='#'||a[i][j+1]=='#'||a[i][j-1]=='#')js[i][j]++;
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
Language: C++

#include <iostream>

int main(int argc, void **argv) {
  int h, w;
  std::cin >> h >> w;
  std::string s;
  int *out = new int[w * h];
  for (int i = 0; i < h; ++i) {
    std::cin >> s;
    for (int j = 0; j < w; ++j) {
      if (s[j] == '#') {
        if (i > 0) {
          if (j > 0) { out[(i - 1) * w + j - 1] ++; }
          out[(i - 1) * w + j] ++;
          if (j < w - 1) { out[(i - 1) * w + j + 1] ++; }
        }
        if (j > 0) { out[i * w + j - 1] ++; }
        out[i* w + j] = 10000;
        if (j < w - 1) { out[i * w + j + 1] ++; }
        if (i < h - 1) {
          if (j > 0) { out[(i + 1) * w + j - 1] ++; }
          out[(i + 1) * w + j] ++;
          if (j < w - 1) { out[(i + 1) * w + j + 1] ++; }
        }
      }
    }
  }

  for (int i = 0; i < h; ++i) {
    for (int j = 0; j < w; ++j) {
      if (out[i * w + j] > 8) {
        std::cout << "#";
      } else {
        std::cout << out[i*w + j];
      }
    }
    std;;cout << std;;endl;
  }
}

Compiler output:
a.cc:3:5: warning: second argument of 'int main(int, void**)' should be 'char **' [-Wmain]
    3 | int main(int argc, void **argv) {
      |     ^~~~
a.cc: In function 'int main(int, void**)':
a.cc:37:8: error: expected primary-expression before ';' token
   37 |     std;;cout << std;;endl;
      |        ^
a.cc:37:10: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   37 |     std;;cout << std;;endl;
      |          ^~~~
      |          std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:37:21: error: expected primary-expression before ';' token
   37 |     std;;cout << std;;endl;
      |                     ^
a.cc:37:23: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   37 |     std;;cout << std;;endl;
      |                       ^~~~
      |                       std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n,m,x,b[1000][1000];
int main()
{
    cin>>n>>m;
    for (int i=1; i<=n; ++i)
    for (int j=1; j<=m; ++j)
    {
        cin>>x;
        if (x=='#') {b[i][j]=-1; b[i][j+1]++; b[i+1][j]++; b[i+1][j+1]++; b[i-1][j]++; b[i][j-1]++; b[i-1][j-1]++; b[i-1][j+1]++; b[i+1][j-1]++;
    }
    for (int i=1; i<=n; ++i)
    {
    for (int j=1; j<=m; ++j)
    if (b[i][j]==-1) cout<<'#';
    else cout<<b[i][j];
    cout<<endl;
    }
    return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
int n,m,x,b[1000][1000];
int main()
{
    cin>>n>>m;
    for (int i=1; i<=n; ++i)
    for (int j=1; j<=m; ++j)
    {
        cin>>x;
        if (x=='#') {b[i][j]=-1; b[i][j+1]++; b[i+1][j]++; b[i+1][j+1]++; b[i-1][j]++; b[i][j-1]++; b[i-1][j-1]++; b[i-1][j+1]++; b[i+1][j-1]++;
    }
    for (int i=1; i<=n; ++i)
    for (int j=1; j<=m; ++j)
    if (b[i][j]==-1) cout<<'#'<<endl;
    else cout<<b[i][j]<<endl;
    return 0;
}

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

1 7
###..#.

Compiler output:
a.cc:2:1: error: stray '##' in program
    2 | ###..#.
      | ^~
a.cc:2:3: error: stray '#' in program
    2 | ###..#.
      |   ^
a.cc:2:6: error: stray '#' in program
    2 | ###..#.
      |      ^
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 1 7
      | ^
Language: C++

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

int main() {
  int H, W;
  cin >> H >> W;
  vector< string > s (H + 2);
  s.at(0) = "..................................................";
  s.at(H + 1) = "..................................................";
  for(int i = 1; i <= H; i++){
    string t;
    cin >> t;
    s.at(i) = '.' + t +'.';
  }
  for(int i = 1; i <= H; i++){
    for(int j = 1; j <= W; j++){
      if(s[i][j] == '.'){
        s[i][j] = 8 - (s[i-1][j-1] + s[i-1][j] + s[i-1][j+1] + s[i][j-1] + s[i][j+1] + s[i+1][j-1] + s[i+1][j] + s[i+1][j+1] - 8 * '#') / ('.' - '#');
      }
    }
  }
  for(int i = 1; i <= H; i++){
    cout << s.at(i).(substr(1, W) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:21: error: expected unqualified-id before '(' token
   23 |     cout << s.at(i).(substr(1, W) << endl;
      |                     ^
a.cc:23:22: error: 'substr' was not declared in this scope; did you mean 'strstr'?
   23 |     cout << s.at(i).(substr(1, W) << endl;
      |                      ^~~~~~
      |                      strstr
Language: C++

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

int main() {
  int H, W;
  cin >> H >> W;
  vector< string > s (H + 2);
  s.at(0) = "..................................................";
  s.at(H + 1) = "..................................................";
  for(int i = 1; i <= H; i++){
    string t
    cin >> t;
    s.at(i) = '.' + t +'.';
  }
  for(int i = 1; i <= H; i++){
    for(int j = 1; j <= W; j++){
      if(s[i][j] == '.'){
        s[i][j] = 8 - (s[i-1][j-1] + s[i-1][j] + s[i-1][j+1] + s[i][j-1] + s[i][j+1] + s[i+1][j-1] + s[i+1][j] + s[i+1][j+1] - 8 * '#') / ('.' - '#');
      }
    }
  }
  for(int i = 1; i <= H; i++){
    cout << s.at(i).(substr(1, W) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: expected initializer before 'cin'
   12 |     cin >> t;
      |     ^~~
a.cc:13:21: error: 't' was not declared in this scope
   13 |     s.at(i) = '.' + t +'.';
      |                     ^
a.cc:23:21: error: expected unqualified-id before '(' token
   23 |     cout << s.at(i).(substr(1, W) << endl;
      |                     ^
a.cc:23:22: error: 'substr' was not declared in this scope; did you mean 'strstr'?
   23 |     cout << s.at(i).(substr(1, W) << endl;
      |                      ^~~~~~
      |                      strstr
Language: C++

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

int main() {
  int H, W;
  cin >> H >> W;
  vector< string > s (H + 2);
  s.at(0) = "..................................................";
  s.at(H + 1) = "..................................................";
  for(int i = 1; i <= H; i++){
    string t
    cin >> t;
    s.at(i) = '.' + t +'.';
  }
  for(int i = 1; i <= H; i++){
    for(int j = 1; j <= W; j++){
      if(s[i][j] == '.'){
        s[i][j] = 8 - (s[i-1][j-1] + s[i-1][j] + s[i-1][j+1] + s[i][j-1] + s[i][j+1] + s[i+1][j-1] + s[i+1][j] + s[i+1][j+1] - 8 * '#') / ('.' - '#');
      }
    }
  }
  for(int i = 1; i <= H; i++){
    cout << s.at(i).(substr(1, W);
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: expected initializer before 'cin'
   12 |     cin >> t;
      |     ^~~
a.cc:13:21: error: 't' was not declared in this scope
   13 |     s.at(i) = '.' + t +'.';
      |                     ^
a.cc:23:21: error: expected unqualified-id before '(' token
   23 |     cout << s.at(i).(substr(1, W);
      |                     ^
a.cc:23:22: error: 'substr' was not declared in this scope; did you mean 'strstr'?
   23 |     cout << s.at(i).(substr(1, W);
      |                      ^~~~~~
      |                      strstr
Language: C++

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

string s[52];

int main(void){
  int h, w;
  cin >> h >> w;
  for(int j=0;j<=w+1;j++) s[0] += '.';
  for(int i=0;i<h;i++){
    cin >> s[i];
    s[i] = '.' + s[i] + '.';
  }
  s[h+1] = s[0];
  
  for(int i=1;i<=h;i++)for(int j=1;j<=w;j++){
    if (s[i][j]=='.'){
      int cnt = 0;
      for(int k=-1;k<2;k++)for(int l=-1;l<2;l++){
        if (s[i+k][j+l]=='#') cnt++;
      }
      s[i][j] = '0' + cnt;
    }    
  }
  
  for(int i=1;i<=h;i++) cout << s[i].substr(1, w) << endl;
  return 0;  
}  

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namesapce'
    2 | using namesapce std;
      |       ^~~~~~~~~
a.cc:4:1: error: 'string' does not name a type; did you mean 'stdin'?
    4 | string s[52];
      | ^~~~~~
      | stdin
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |   cin >> h >> w;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:27: error: 's' was not declared in this scope
    9 |   for(int j=0;j<=w+1;j++) s[0] += '.';
      |                           ^
a.cc:11:12: error: 's' was not declared in this scope
   11 |     cin >> s[i];
      |            ^
a.cc:14:3: error: 's' was not declared in this scope
   14 |   s[h+1] = s[0];
      |   ^
a.cc:26:25: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   26 |   for(int i=1;i<=h;i++) cout << s[i].substr(1, w) << endl;
      |                         ^~~~
      |                         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:26:54: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   26 |   for(int i=1;i<=h;i++) cout << s[i].substr(1, w) << endl;
      |                                                      ^~~~
      |                                                      std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: Java

import java.util.Scanner;

public class Mine {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int H = sc.nextInt();
        int W = sc.nextInt();
        char[][] c = new char[H+ 2][W + 2];
        for (int i = 0; i < H; i++) {
            String s = sc.next();
            for (int j = 0; j < W; j++) {
                c[i + 1][j + 1] = s.charAt(j);
            }
        }
        for (int i = 1 ; i <= H ; i++) {
            for (int j = 1 ; j <= W ; j++) {
                int count = 0;
                if (c[i][j] == '.') {
                    count += countBomb(i - 1, j - 1, c);
                    count += countBomb(i - 1 , j, c);
                    count += countBomb(i - 1, j + 1, c);
                    count += countBomb(i , j - 1 , c);
                    count += countBomb(i, j + 1, c);
                    count += countBomb(i + 1, j - 1, c);
                    count += countBomb(i + 1, j, c);
                    count += countBomb(i + 1, j + 1, c);
                    c[i][j] =  (char)('0' + count);
                }
                System.out.print(c[i][j]);
            }
            System.out.println("");
        }
    }

    static int countBomb (int i , int j, char [][] c ) {
        if (c[i][j] == '#') {
            return 1;
        } else {
            return 0;
        }
    }

}

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

#include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,n)  FOR(i,0,n)
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<vector<P>> Graph;


int main(){

  int h,w;
  cin >> h >> w;
  
  char c[h+2][w+2];
  
  REP(i,h){
    REP(j,w){
      cin >> char c[i+1][j+1];
    }
  }
  
  int vx[8] = {1,1,1,0,0,-1,-1,-1};
  int vy[8] = {1,0,-1,1,-1,1,0,-1};
  
  char ans[h][w];
  REP(i,h){
    REP(j,w){
      if(c[i+1][j+1] == '#') ans[i][j] = '#';
      else{
        int cnt = 0;
      REP(k,8){
      if(c[i+1+vx[k]][j+1+vy[k]] == '#') cnt++;
      }
        ans[i][j] = (char)cnt + '0';
      }
    }
  }

  REP(i,h){
    REP(j,w){
      cout << ans[i][j];
    }
    cout << endl;
  }

 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:14: error: expected primary-expression before 'char'
   23 |       cin >> char c[i+1][j+1];
      |              ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int a,b,d;
char c[50][50];
int main(){
    cin>>a>>b;
    for(int i=0;i<a;i++){
        for(int j=0;j<b;j++)cin>>c[i][j];
    for(int i=0;i<a;i++){
        for(int j=0;j<b;j++){
            d=0;
            if(c[i][j]=='#')cout<<"#";
            else{
                if(c[i-1][j-1]=='#')d++;
                if(c[i-1][j]=='#')d++;
                if(c[i-1][j+1]=='#')d++;
                if(c[i][j-1]=='#')d++;
                if(c[i][j+1]=='#')d++;
                if(c[i+1][j-1]=='#')d++;
                if(c[i+1][j]=='#')d++;
                if(c[i+1][j+1]=='#')d++;
                cout<<d;
            }
        }
        cout<<endl;
    }
    return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
const long long INF = numeric_limits<long long>::max();
int main()
{
	int H, W;
	cin >> H >> W;
	vector<string> S( H );
	for( auto &x : S )
	{
		cin >> x;
	}
	for( int i = 0; i < H; ++i )
	{
		for( int j = 0; j < W; ++j )
		{
			if( S[ i ][ j ] == '#' )
			{
				continue;
			}
			int cnt{};
			for( int k = i - 1; k <= i + 1; ++k )
			{
				for( int l = j - 1; l <= j + 1; ++l )
				{
					if( k >= 0 && l >= 0 && k != H && l != W && S[ k ][ l ] =='#' )
					{
						cnt++;
					}
				}
				S[ i ][ j ] = '0' + cnt;
			}
		}
	}
	for( auto &x : S )
	{
		cout << x << endl;
	}
	return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:43:18: error: expected '}' at end of input
   43 |         return 0;
      |                  ^
a.cc:9:1: note: to match this '{'
    9 | {
      | ^
Language: C++

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

int main(void){
  int h,w;
  cin >> h >> w;
  string board[50];
  
  for(int i = 0; i < h; i++) cin >> board[i];
  
  const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
  const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
  
  for(int i = 0; i < h; i++){
    for(int j = 0; j < w; j++){
      if(board[i][j] == '#') continue;
      
      int num;
      for(int d = 0; d < 8; d++){
      	const int ni = i + dx[d];
        const int nj = j + dy[d];
        
        if(ni < 0 or h < ni) continue;
        if(nj < 0 or w < nj) continue;
        if(board[ni][nj] == '#') num++;
      }
      board[i][j] = char(num + '0')
    }
  }
  for (int i = 0; i < h; ++i) cout << board[i] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:36: error: expected ';' before '}' token
   29 |       board[i][j] = char(num + '0')
      |                                    ^
      |                                    ;
   30 |     }
      |     ~
Language: C++

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

int main(void){
  int h,w;
  cin >> h >> w;
  string board[50];
  
  for(int i = 0; i < h; i++) cin >> board[i];
  
  const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
  const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
  
  for(int i = 0; i < h; i++){
    for(int j = 0; j < W; j++){
      if(board[i][j] == '#') continue;
      
      int num;
      for(int d = 0; d < 8; d++){
      	const int ni = i + dx[d];
        const int nj = j + dy[d];
        
        if(ni < 0 or h < ni) continue;
        if(nj < 0 or w < nj) continue;
        if(board[ni][nj] == '#') num++;
      }
      board[i][j] = char(num + '0')
    }
  }
  for (int i = 0; i < h; ++i) cout << board[i] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:24: error: 'W' was not declared in this scope
   17 |     for(int j = 0; j < W; j++){
      |                        ^
a.cc:29:36: error: expected ';' before '}' token
   29 |       board[i][j] = char(num + '0')
      |                                    ^
      |                                    ;
   30 |     }
      |     ~
Language: C++

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

int main(void){
  int h,w;
  cin >> h >> w;
  string board[50];
  
  for(int i = 0; i < h; i++) cin >> board[i];
  
  const int dx[8] = {-1,0,1,-1,0,1,-1,0,1};
  const int dy[8] = {-1,-1,-1,0,0,0,1,1,1};
  
  for(int i = 0; i < h; i++){
    for(int j = 0; j < W; j++){
      if(board[i][j] == '#') continue;
      
      int num;
      for(int d = 0; d < 8; d++){
      	const int ni = i + dx[d];
        const int nj = j + dy[d];
        
        if(ni < 0 or h < ni) continue;
        if(nj < 0 or w < nj) continue;
        if(board[ni][nj] == '#') num++;
      }
      board[i][j] = char(num + '0')
    }
  }
  for (int i = 0; i < h; ++i) cout << board[i] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:42: error: too many initializers for 'const int [8]'
   13 |   const int dx[8] = {-1,0,1,-1,0,1,-1,0,1};
      |                                          ^
a.cc:14:42: error: too many initializers for 'const int [8]'
   14 |   const int dy[8] = {-1,-1,-1,0,0,0,1,1,1};
      |                                          ^
a.cc:17:24: error: 'W' was not declared in this scope
   17 |     for(int j = 0; j < W; j++){
      |                        ^
a.cc:29:36: error: expected ';' before '}' token
   29 |       board[i][j] = char(num + '0')
      |                                    ^
      |                                    ;
   30 |     }
      |     ~
Language: C++

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

int main(void){
  int h,w;
  cin >> h >> w;
  string board[50];
  
  for(int i = 0; i < h; i++) cin >> board[i];
  
  const int dx[8] = [-1,0,1,-1,0,1,-1,0,1];
  const int dy[8] = [-1,-1,-1,0,0,0,1,1,1];
  
  for(int i = 0; i < h; i++){
    for(int j = 0; j < W; j++){
      if(board[i][j] == '#') continue;
      
      int num;
      for(int d = 0; d < 8; d++){
      	const int ni = i + dx[d];
        const int nj = j + dy[d];
        
        if(ni < 0 or h < ni) continue;
        if(nj < 0 or w < nj) continue;
        if(board[ni][nj] == '#') num++;
      }
      board[i][j] = char(num + '0')
    }
  }
  for (int i = 0; i < h; ++i) cout << board[i] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:22: error: expected identifier before '-' token
   13 |   const int dx[8] = [-1,0,1,-1,0,1,-1,0,1];
      |                      ^
a.cc:13:24: error: expected ']' before ',' token
   13 |   const int dx[8] = [-1,0,1,-1,0,1,-1,0,1];
      |                        ^
      |                        ]
a.cc: In lambda function:
a.cc:13:24: error: expected '{' before ',' token
a.cc: In function 'int main()':
a.cc:13:21: error: array must be initialized with a brace-enclosed initializer
   13 |   const int dx[8] = [-1,0,1,-1,0,1,-1,0,1];
      |                     ^~~
a.cc:13:25: error: expected unqualified-id before numeric constant
   13 |   const int dx[8] = [-1,0,1,-1,0,1,-1,0,1];
      |                         ^
a.cc:14:22: error: expected identifier before '-' token
   14 |   const int dy[8] = [-1,-1,-1,0,0,0,1,1,1];
      |                      ^
a.cc:14:24: error: expected ']' before ',' token
   14 |   const int dy[8] = [-1,-1,-1,0,0,0,1,1,1];
      |                        ^
      |                        ]
a.cc: In lambda function:
a.cc:14:24: error: expected '{' before ',' token
a.cc: In function 'int main()':
a.cc:14:21: error: array must be initialized with a brace-enclosed initializer
   14 |   const int dy[8] = [-1,-1,-1,0,0,0,1,1,1];
      |                     ^~~
a.cc:14:25: error: expected unqualified-id before '-' token
   14 |   const int dy[8] = [-1,-1,-1,0,0,0,1,1,1];
      |                         ^
a.cc:17:24: error: 'W' was not declared in this scope
   17 |     for(int j = 0; j < W; j++){
      |                        ^
a.cc:29:36: error: expected ';' before '}' token
   29 |       board[i][j] = char(num + '0')
      |                                    ^
      |                                    ;
   30 |     }
      |     ~
Language: C++

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

int main(void){
  int h,w;
  cin >> h >> w;
  string board[50];
  
  for(int i = 0; i < h; i++) cin >> board[i];
  
  const dx[8] = [-1,0,1,-1,0,1,-1,0,1];
  const dy[8] = [-1,-1,-1,0,0,0,1,1,1];
  
  for(int i = 0; i < h; i++){
    for(int j = 0; j < W; j++){
      if(board[i][j] == '#') continue;
      
      int num;
      for(int d = 0; d < 8; d++){
      	const int ni = i + dx[d];
        const int nj = j + dy[d];
        
        if(ni < 0 or h < ni) continue;
        if(nj < 0 or w < nj) continue;
        if(board[ni][nj] == '#') num++;
      }
      board[i][j] = char(num + '0')
    }
  }
  for (int i = 0; i < h; ++i) cout << board[i] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'dx' does not name a type
   13 |   const dx[8] = [-1,0,1,-1,0,1,-1,0,1];
      |         ^~
a.cc:14:9: error: 'dy' does not name a type
   14 |   const dy[8] = [-1,-1,-1,0,0,0,1,1,1];
      |         ^~
a.cc:17:24: error: 'W' was not declared in this scope
   17 |     for(int j = 0; j < W; j++){
      |                        ^
a.cc:22:28: error: 'dx' was not declared in this scope; did you mean 'd'?
   22 |         const int ni = i + dx[d];
      |                            ^~
      |                            d
a.cc:23:28: error: 'dy' was not declared in this scope; did you mean 'd'?
   23 |         const int nj = j + dy[d];
      |                            ^~
      |                            d
a.cc:29:36: error: expected ';' before '}' token
   29 |       board[i][j] = char(num + '0')
      |                                    ^
      |                                    ;
   30 |     }
      |     ~
Language: C++

#include <iostream>
using namespace std;
int main(void) {
    int h, w;
    cin >> h >> w;
    string board[50];
    for (int i = 0; i < h; ++i) cin >> board[i];
    const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
    const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
    for (int i = 0; i < h; ++i) {
        for (int j = 0; j < w; ++j) {
            if (board[i][j] == ’#’) continue;
            int num = 0;
            for (int d = 0; d < 8; ++ d) {
                const int ni = i + dy[d];
                const int nj = j + dx[d];
                if (ni < 0 or h <= ni) continue;
                if (nj < 0 or w <= nj) continue;
                if (board[ni][nj] == ’#’) num++;
            }
        board[i][j] = char(num + ’0’);
        }
    }
    for (int i = 0; i < h; ++i) cout << board[i] << endl;
    return 0;
}

Compiler output:
a.cc:12:32: error: extended character ’ is not valid in an identifier
   12 |             if (board[i][j] == ’#’) continue;
      |                                ^
a.cc:12:33: error: stray '#' in program
   12 |             if (board[i][j] == ’#’) continue;
      |                                 ^
a.cc:12:34: error: extended character ’ is not valid in an identifier
   12 |             if (board[i][j] == ’#’) continue;
      |                                  ^
a.cc:19:38: error: extended character ’ is not valid in an identifier
   19 |                 if (board[ni][nj] == ’#’) num++;
      |                                      ^
a.cc:19:39: error: stray '#' in program
   19 |                 if (board[ni][nj] == ’#’) num++;
      |                                       ^
a.cc:19:40: error: extended character ’ is not valid in an identifier
   19 |                 if (board[ni][nj] == ’#’) num++;
      |                                        ^
a.cc:21:34: error: extended character ’ is not valid in an identifier
   21 |         board[i][j] = char(num + ’0’);
      |                                  ^
a.cc:21:34: error: extended character ’ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:12:32: error: '\U00002019' was not declared in this scope
   12 |             if (board[i][j] == ’#’) continue;
      |                                ^
a.cc:12:33: error: expected ')' before '\U00002019'
   12 |             if (board[i][j] == ’#’) continue;
      |                ~                ^~
      |                                 )
a.cc:19:38: error: '\U00002019' was not declared in this scope
   19 |                 if (board[ni][nj] == ’#’) num++;
      |                                      ^
a.cc:19:39: error: expected ')' before '\U00002019'
   19 |                 if (board[ni][nj] == ’#’) num++;
      |                    ~                  ^~
      |                                       )
a.cc:21:34: error: '\U000020190\U00002019' was not declared in this scope
   21 |         board[i][j] = char(num + ’0’);
      |                                  ^~~
Language: C++

using namespace std;
int h, w, bom[50][50];
int dx[8] = {1, 1, 1, 0, 0, -1, -1, -1};
int dy[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
string field[50];

int main(void){
    // Your code here!
    cin >> h >> w;
    for (int i = 0; i < h; i++) cin >> field[i];
    for (int x = 0; x < h; x++) {
        for (int y = 0; y < w; y++) {
            if (field[x][y] == '#') {
                for (int i = 0; i < 8; i++) {
                    int nx = x + dx[i], ny = y + dy[i];
                    if (nx >= 0 && nx < h && ny >= 0 && ny < w && field[nx][ny] != '#') bom[nx][ny]++;
                }
            }
        }
    }
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            if (field[i][j] == '#') cout << '#';
            else cout << bom[i][j];
        }
        cout << endl;
    }
}

Compiler output:
a.cc:5:1: error: 'string' does not name a type
    5 | string field[50];
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:9:5: error: 'cin' was not declared in this scope
    9 |     cin >> h >> w;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:10:40: error: 'field' was not declared in this scope; did you mean 'friend'?
   10 |     for (int i = 0; i < h; i++) cin >> field[i];
      |                                        ^~~~~
      |                                        friend
a.cc:13:17: error: 'field' was not declared in this scope; did you mean 'friend'?
   13 |             if (field[x][y] == '#') {
      |                 ^~~~~
      |                 friend
a.cc:23:17: error: 'field' was not declared in this scope; did you mean 'friend'?
   23 |             if (field[i][j] == '#') cout << '#';
      |                 ^~~~~
      |                 friend
a.cc:23:37: error: 'cout' was not declared in this scope
   23 |             if (field[i][j] == '#') cout << '#';
      |                                     ^~~~
a.cc:23:37: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:24:18: error: 'cout' was not declared in this scope
   24 |             else cout << bom[i][j];
      |                  ^~~~
a.cc:24:18: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:26:9: error: 'cout' was not declared in this scope
   26 |         cout << endl;
      |         ^~~~
a.cc:26:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:26:17: error: 'endl' was not declared in this scope
   26 |         cout << endl;
      |                 ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

#include <iostream>
#include <string>
#include <map>
#include <stdio.h>
#include <stdlib.h>

using namespace std;

int main(){
  int H,W;
  cin >> H >> W;
  map<int, string> S;

  for(int i = 0; i < H; i++){
    cin >> S[i];
  }

  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      int count = 0;
      if(S[i][j] == '.'){
        count = 0;
        for(int diffH = -1; diffH <= 1; diffH++){
          if(diffH + i < 0 || diffH + i >= H) continue;
          for(int diffW = -1; diffW <= 1; diffW++){
            if(diffW + j < 0 || diffW + j >= W) continue;
            if(S[diffH + i][diffW + j] == '#') count++;
          }
        }
        //S[i][j] = count;
        itoa(count,S[i][j],10);
      }
    }
    cout << S[i];
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:9: error: 'itoa' was not declared in this scope
   31 |         itoa(count,S[i][j],10);
      |         ^~~~
Language: C++

#include <iostream>
#include <string>
#include <map>

using namespace std;

int main(){
  int H,W;
  cin >> H >> W;
  map<int, string> S;

  for(int i = 0; i < H; i++){
    cin >> S[i];
  }

  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      int count = 0;
      if(S[i][j] == '.'){
        count = 0;
        for(int diffH = -1; diffH <= 1; diffH++){
          if(diffH + i < 0 || diffH + i >= H) continue;
          for(int diffW = -1; diffW <= 1; diffW++){
            if(diffW + j < 0 || diffW + j >= W) continue;
            if(S[diffH + i][diffW + j] == '#') count++;
          }
        }
        //S[i][j] = count;
        itoa(count,S[i][j],10);
      }
    }
    cout << S[i];
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:9: error: 'itoa' was not declared in this scope
   29 |         itoa(count,S[i][j],10);
      |         ^~~~
Language: C++

#include <iostream>
#include <string>
#include <map>

using namespace std;

int main(){
  int H,W;
  cin >> H >> W;
  map<int, string> S;

  for(int i = 0; i < H; i++){
    cin >> S[i];
  }

  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      int count = 0;
      if(S[i][j] == "."){
        count = 0;
        for(int diffH = -1; diffH <= 1; diffH++){
          if(diffH + i < 0 || diffH + i >= H) continue;
          for(int diffW = -1; diffW <= 1; diffW++){
            if(diffW + j < 0 || diffW + j >= W) continue;
            count++;
          }
        }
        S[i][j] = count;
      }
    }
    cout << S[i];
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   19 |       if(S[i][j] == "."){
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define pii pair<int,int>
#define valid(nx,ny,r,c) nx>=0 && nx<r && ny>=0 && ny<c
int fx[]= {+0,+0,+1,-1,-1,+1,-1,+1};
int fy[]= {-1,+1,+0,+0,+1,+1,-1,-1};
 
char cell[50][50];
int main() {
    int i,j,k,r,c;
    cin>>r>>c;
    cin.ignore();
   for(i=0; i<r; i++) {
        for(j=0; j<c; j++)
            cin>>cell[i][j];
 
 
    for(i=0; i<r; i++) {
        for(j=0; j<c; j++) {
            int cnt=0;
            if(cell[i][j]=='.') {
                for(k=0; k<8; k++) {
                    int nx=i+fx[k];
                    int ny=j+fy[k];
                        if(cell[nx][ny]=='#')
                        cnt++;
 
 
                }
                cell[i][j]=cnt+'0';
            }
        }
    }
 
    for(i=0; i<r; i++) {
        for(j=0; j<c; j++)
            cout<<cell[i][j];
        cout<<endl;
    }
 
 
 
    return 0;
 
}

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


   #include <bits/stdc++.h>
using namespace std;
#define pii pair<int,int>
#define valid(nx,ny,r,c) nx>=0 && nx<r && ny>=0 && ny<c
int fx[]= {+0,+0,+1,-1,-1,+1,-1,+1};
int fy[]= {-1,+1,+0,+0,+1,+1,-1,-1};

char cell[50][50];
int main() {
    int i,j,k,r,c;
    cin>>r>>c;
    cin.ignore();
    for(i=0; i<r; i++) {
        gets(cell[i]);
    }


    for(i=0; i<r; i++) {
        for(j=0; j<c; j++) {
            int cnt=0;
            if(cell[i][j]=='.') {
                for(k=0; k<8; k++) {
                    int nx=i+fx[k];
                    int ny=j+fy[k];
                    if(valid(nx,ny,r,c))
                    {
                        if(cell[nx][ny]=='#')
                        cnt++;
                    }

                }
                cell[i][j]=cnt+'0';
            }
        }
    }

    for(i=0; i<r; i++) {
        for(j=0; j<c; j++)
            cout<<cell[i][j];
        cout<<endl;
    }



    return 0;

}





Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   15 |         gets(cell[i]);
      |         ^~~~
      |         getw
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define pii pair<int,int>
#define valid(nx,ny,r,c) nx>=0 && nx<r && ny>=0 && ny<c
int fx[]= {+0,+0,+1,-1,-1,+1,-1,+1};
int fy[]= {-1,+1,+0,+0,+1,+1,-1,-1};

char cell[50][50];
int main() {
    int i,j,k,r,c;
    cin>>r>>c;
    cin.ignore();
    for(i=0; i<r; i++) {
        gets(cell[i]);
    }


    for(i=0; i<r; i++) {
        for(j=0; j<c; j++) {
            int cnt=0;
            if(cell[i][j]=='.') {
                for(k=0; k<8; k++) {
                    int nx=i+fx[k];
                    int ny=j+fy[k];
                        if(cell[nx][ny]=='#')
                        cnt++;


                }
                cell[i][j]=cnt+'0';
            }
        }
    }

    for(i=0; i<r; i++) {
        for(j=0; j<c; j++)
            cout<<cell[i][j];
        cout<<endl;
    }



    return 0;

}





Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   14 |         gets(cell[i]);
      |         ^~~~
      |         getw
Language: C++

#include<bits/stdc++.h>
#define debug(i,j) cerr<< (i)<< " : "<< j << "\n";
using namespace std;


int main(void)
{
    int h, w;
    cin >> h >> w;
    char dummy[2];
    gets(dummy);
    char g[100][100];
    for(int i=0;i<h;++i)
        gets(g[i]);

        for(int i=0;i<h;++i)for(int j=0;j<w;++j){
            if(g[i][j]=='#')continue;
            else{
                const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
                const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
                char num = '0';
                for(int d =0;d<8; ++d){
                    int x = i + dx[d];
                    int y = j + dy[d];
                    if(x<0 || x>=h || y<0 || y>=w)continue;
                    else if(g[x][y]=='#')num++;
                }
                g[i][j] = num;
            }
        }

    for(int i=0;i<h;i++)
    {
       cout<<g[i]<<"\n";
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
   11 |     gets(dummy);
      |     ^~~~
      |     getw
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<vector>
#include<functional>
#include<iomanip>
#include<cmath>
#include<queue>
#include<limits>
#include<cassert>
#include<set>
#include<tuple>
#include<map>
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
typedef long long ll;
using namespace std;

int main() {
	int X,Y; cin >> X >> Y;
	string board[60];
	
	for (int i = 0; i < X; ++i) cin >> board[i];
	
	int dx[] = {-1,-1,-1,0,0,1,1,1};
	int dy[] = {0,-1,1,-1,1,-1,0,1};
	
	for (int i = 0; i < X; ++i) {
		for (int  j = 0; j < Y ++j) {
			if (board[i][j] == '.') {
				int cnt = 0;
				for (int k = 0; k < 8; ++k) {
					int x = i + dx[k];
					int y = i + dy[k];
					if (x >= 0 && x < X && y >= 0 && y < Y && board[x][y] == '#') ++cnt;
				}
				board [i][j] = '0' + cnt;
			}
		}
	}
	for (int i = 0; i < N; ++i) cout << board[i] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:42: error: expected ';' before 'j'
   33 |                 for (int  j = 0; j < Y ++j) {
      |                                          ^
      |                                          ;
a.cc:45:29: error: 'N' was not declared in this scope
   45 |         for (int i = 0; i < N; ++i) cout << board[i] << endl;
      |                             ^