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

import java.util.Scanner;
 
public class Main {
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int H = sc.nextInt();//マス目の設定
        int W = sc.nextInt();
        String[][] map;
      	int[][] result;
      	map=new String [H][W];
      	result=new int[H][W];
       	
      
      	for(int i=0;i<H;i++) {//データの打ち込み
          for(int j=0;j<W;j++){
			map[i][j]=sc.next();
          }
		}
     	for(int i=0;i<H;i++) {//データの打ち込み
          for(int j=0;j<W;j++){
			result[i][j]=-1;
          }
		}
      
      	for(int i=0;i<H;i++) {//変換
          for(int j=0;j<W;j++){
           	if(map[i][j]=="."){
              result[H][W]="0";
              
              if(map[i][j+1]=="#"){
				result[i][j]+=1;
              }
              if(map[i][j-1]=="#"){
				result[i][j]+=1;
              }
              if(map[i+1][j]=="#"){
				result[i][j]+=1;
              }
              if(map[i-1][j]=="#"){
				result[i][j]+=1;
              }
              if(map[i+1][j+1]=="#"){
				result[i][j]+=1;
              }
              if(map[i-1][j+1]=="#"){
				result[i][j]+=1;
              }
              if(map[i+1][j-1]=="#"){
				result[i][j]+=1;
              }
              if(map[i-1][j-1]=="#"){
				result[i][j]+=1;
              }
              
           	}
          }
		}
      
      
      for(int i=0;i<H;i++) {//データの書き出し
        for(int j=0;j<W-1;j++){
          if(result[i][j]==-1){
			System.out.print(map[i][j]);
          }else{
          	System.out.print(result[i][j]);
          }
        }
      }  
		if(result[i][W]==-1){
		  System.out.println(map[i][W]);
        }else{
          System.out.println(result[i][W]);
        } 
        
	  
      
    }
}


Compiler output:
Main.java:29: error: incompatible types: String cannot be converted to int
              result[H][W]="0";
                           ^
Main.java:70: error: cannot find symbol
		if(result[i][W]==-1){
		          ^
  symbol:   variable i
  location: class Main
Main.java:71: error: cannot find symbol
		  System.out.println(map[i][W]);
		                         ^
  symbol:   variable i
  location: class Main
Main.java:73: error: cannot find symbol
          System.out.println(result[i][W]);
                                    ^
  symbol:   variable i
  location: class Main
4 errors
Language: Java

import java.util.Scanner;
 
public class Main {
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int H = sc.nextInt();//マス目の設定
        int W = sc.nextInt();
        String[][] map;
      	map=new String [H][W];
      	result=new int[H][W];
       	
      
      	for(int i=0;i<H;i++) {//データの打ち込み
          for(int j=0;j<W;j++){
			map[i][j]=sc.next();
          }
		}
     	for(int i=0;i<H;i++) {//データの打ち込み
          for(int j=0;j<W;j++){
			result[i][j]=-1;
          }
		}
      
      	for(int i=0;i<H;i++) {//変換
          for(int j=0;j<W;j++){
           	if(map[i][j]=="."){
              result[H][W]="0";
              
              if(map[i][j+1]=="#"){
				result[i][j]+=1;
              }
              if(map[i][j-1]=="#"){
				result[i][j]+=1;
              }
              if(map[i+1][j]=="#"){
				result[i][j]+=1;
              }
              if(map[i-1][j]=="#"){
				result[i][j]+=1;
              }
              if(map[i+1][j+1]=="#"){
				result[i][j]+=1;
              }
              if(map[i-1][j+1]=="#"){
				result[i][j]+=1;
              }
              if(map[i+1][j-1]=="#"){
				result[i][j]+=1;
              }
              if(map[i-1][j-1]=="#"){
				result[i][j]+=1;
              }
              
           	}
          }
		}
      
      
      for(int i=0;i<H;i++) {//データの書き出し
        for(int j=0;j<W-1;j++){
          if(result[i][j]==-1){
			System.out.print(map[i][j]);
          }even if{
          	System.out.print(result[i][j])
          }
        }
      }  
		if(result[i][W]==-1){
		  System.out.println(map[i][W]);
        }even if{
          System.out.println(result[i][])
        } 
        
	  
      
    }
}


Compiler output:
Main.java:64: error: not a statement
          }even if{
           ^
Main.java:64: error: ';' expected
          }even if{
               ^
Main.java:64: error: '(' expected
          }even if{
                  ^
Main.java:65: error: ';' expected
          	System.out.print(result[i][j])
          	                              ^
Main.java:71: error: not a statement
        }even if{
         ^
Main.java:71: error: ';' expected
        }even if{
             ^
Main.java:71: error: '(' expected
        }even if{
                ^
Main.java:72: error: illegal start of expression
          System.out.println(result[i][])
                                       ^
Main.java:72: error: ';' expected
          System.out.println(result[i][])
                                         ^
9 errors
Language: Java

import java.util.Scanner;
 
public class Main {
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int H = sc.nextInt();//マス目の設定
        int W = sc.nextInt();
        String[][] map;
      	map=new String [H][W];
       	
      
      	for(int i=0;i<H;i++) {//データの打ち込み
          for(int j=0;j<W;j++){
			map[i][j]=sc.next();
          }
		}
      
      	for(int i=0;i<H;i++) {//変換
          for(int j=0;j<W;j++){
           	if(map[i][j]=="."){
              map[i][j]=0;
              
              if(map[i][j+1]=="#"){
				map[i][j]+=1;
              }
              if(map[i][j-1]=="#"){
				map[i][j]+=1;
              }
              if(map[i+1][j]=="#"){
				map[i][j]+=1;
              }
              if(map[i-1][j]=="#"){
				map[i][j]+=1;
              }
              if(map[i+1][j+1]=="#"){
				map[i][j]+=1;
              }
              if(map[i-1][j+1]=="#"){
				map[i][j]+=1;
              }
              if(map[i+1][j-1]=="#"){
				map[i][j]+=1;
              }
              if(map[i-1][j-1]=="#"){
				map[i][j]+=1;
              }
              
           	}
          }
		}
      
      
      for(int i=0;i<H;i++) {//データの書き出し
        for(int j=0;j<W-1;j++){
			System.out.print(map[i][j]);
        }
		System.out.println(map[i][W]);
	  }
      
    }
}


Compiler output:
Main.java:22: error: incompatible types: int cannot be converted to String
              map[i][j]=0;
                        ^
1 error
Language: Java

import java.util.Scanner;
 
public class Main {
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int H = sc.nextInt();//マス目の設定
        int W = sc.nextInt();
        String[][] map;
      	map=new String [H][W];
       	
      
      	for(int i=0;i<H;i++) {//データの打ち込み
          for(int j=0;j<W;j++){
			map[i][j]=sc.nextString();
          }
		}
      
      	for(int i=0;i<H;i++) {//変換
          for(int j=0;j<W;j++){
           	if(map[i][j]=="."){
              map[i][j]=0;
              
              if(map[i][j+1]=="#"){
				map[i][j]+=1;
              }
              if(map[i][j-1]=="#"){
				map[i][j]+=1;
              }
              if(map[i+1][j]=="#"){
				map[i][j]+=1;
              }
              if(map[i-1][j]=="#"){
				map[i][j]+=1;
              }
              if(map[i+1][j+1]=="#"){
				map[i][j]+=1;
              }
              if(map[i-1][j+1]=="#"){
				map[i][j]+=1;
              }
              if(map[i+1][j-1]=="#"){
				map[i][j]+=1;
              }
              if(map[i-1][j-1]=="#"){
				map[i][j]+=1;
              }
              
           	}
          }
		}
      
      
      for(int i=0;i<H;i++) {//データの書き出し
        for(int j=0;j<W-1;j++){
			System.out.print(map[i][j]);
        }
		System.out.println(map[i][W]);
	  }
      
    }
}


Compiler output:
Main.java:15: error: cannot find symbol
			map[i][j]=sc.nextString();
			            ^
  symbol:   method nextString()
  location: variable sc of type Scanner
Main.java:22: error: incompatible types: int cannot be converted to String
              map[i][j]=0;
                        ^
2 errors
Language: Java

import java.util.Scanner;
 
public class Main {
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int H = sc.nextInt();//マス目の設定
        int W = sc.nextInt();
        String[][] map;
      	map=new String [H][W];
       	
      
      	for(int i=0;i<H;i++) {//データの打ち込み
          for(int j=0;j<W;j++){
			map[i][j]=sc.nextInt();
          }
		}
      
      	for(int i=0;i<H;i++) {//変換
          for(int j=0;j<W;j++){
           	if(map[i][j]=="."){
              map[i][j]=0;
              
              if(map[i][j+1]=="#"){
				map[i][j]+=1;
              }
              if(map[i][j-1]=="#"){
				map[i][j]+=1;
              }
              if(map[i+1][j]=="#"){
				map[i][j]+=1;
              }
              if(map[i-1][j]=="#"){
				map[i][j]+=1;
              }
              if(map[i+1][j+1]=="#"){
				map[i][j]+=1;
              }
              if(map[i-1][j+1]=="#"){
				map[i][j]+=1;
              }
              if(map[i+1][j-1]=="#"){
				map[i][j]+=1;
              }
              if(map[i-1][j-1]=="#"){
				map[i][j]+=1;
              }
              
           	}
          }
		}
      
      
      for(int i=0;i<H;i++) {//データの書き出し
        for(int j=0;j<W-1;j++){
			System.out.print(map[i][j]);
        }
		System.out.println(map[i][W]);
	  }
      
    }
}


Compiler output:
Main.java:15: error: incompatible types: int cannot be converted to String
			map[i][j]=sc.nextInt();
			                    ^
Main.java:22: error: incompatible types: int cannot be converted to String
              map[i][j]=0;
                        ^
2 errors
Language: Java

import java.util.Scanner;
 
public class Main {
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int H = sc.nextInt();//マス目の設定
        int W = sc.nextInt();
        static public String[][] map;
      	map=new String [H][W];
       	
      
      	for(int i=0;i<H;i++) {//データの打ち込み
          for(int j=0;j<W;j++){
			map[i][j]=sc.nextInt();
          }
		}
      
      	for(int i=0;i<H;i++) {//変換
          for(int j=0;j<W;j++){
           	if(map[i][j]=="."){
              map[i][j]=0;
              
              if(map[i][j+1]=="#"){
				map[i][j]+=1;
              }
              if(map[i][j-1]=="#"){
				map[i][j]+=1;
              }
              if(map[i+1][j]=="#"){
				map[i][j]+=1;
              }
              if(map[i-1][j]=="#"){
				map[i][j]+=1;
              }
              if(map[i+1][j+1]=="#"){
				map[i][j]+=1;
              }
              if(map[i-1][j+1]=="#"){
				map[i][j]+=1;
              }
              if(map[i+1][j-1]=="#"){
				map[i][j]+=1;
              }
              if(map[i-1][j-1]=="#"){
				map[i][j]+=1;
              }
              
           	}
          }
		}
      
      
      for(int i=0;i<H;i++) {//データの書き出し
        for(int j=0;j<W-1;j++){
			System.out.print(map[i][j]);
        }
		System.out.println(map[i][W]);
	  }
      
    }
}


Compiler output:
Main.java:9: error: illegal start of expression
        static public String[][] map;
        ^
Main.java:10: error: <identifier> expected
      	map=new String [H][W];
      	   ^
Main.java:13: error: illegal start of type
      	for(int i=0;i<H;i++) {//????????
      	^
Main.java:13: error: > or ',' expected
      	for(int i=0;i<H;i++) {//????????
      	               ^
Main.java:13: error: <identifier> expected
      	for(int i=0;i<H;i++) {//????????
      	                 ^
Main.java:19: error: illegal start of type
      	for(int i=0;i<H;i++) {//??
      	^
Main.java:19: error: > or ',' expected
      	for(int i=0;i<H;i++) {//??
      	               ^
Main.java:19: error: <identifier> expected
      	for(int i=0;i<H;i++) {//??
      	                 ^
Main.java:54: error: illegal start of type
      for(int i=0;i<H;i++) {//????????
      ^
Main.java:54: error: > or ',' expected
      for(int i=0;i<H;i++) {//????????
                     ^
Main.java:54: error: <identifier> expected
      for(int i=0;i<H;i++) {//????????
                       ^
Main.java:62: error: class, interface, enum, or record expected
}
^
12 errors
Language: Java

import java.util.Scanner;
 
public class Main {
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int H = sc.nextInt();//マス目の設定
        int W = sc.nextInt();
        ststic public String[][] map;
      	map=new String [H][W];
       	
      
      	for(int i=0;i<H;i++) {//データの打ち込み
          for(int j=0;j<W;j++){
			map[i][j]=sc.nextInt();
          }
		}
      
      	for(int i=0;i<H;i++) {//変換
          for(int j=0;j<W;j++){
           	if(map[i][j]=="."){
              map[i][j]=0;
              
              if(map[i][j+1]=="#"){
				map[i][j]+=1;
              }
              if(map[i][j-1]=="#"){
				map[i][j]+=1;
              }
              if(map[i+1][j]=="#"){
				map[i][j]+=1;
              }
              if(map[i-1][j]=="#"){
				map[i][j]+=1;
              }
              if(map[i+1][j+1]=="#"){
				map[i][j]+=1;
              }
              if(map[i-1][j+1]=="#"){
				map[i][j]+=1;
              }
              if(map[i+1][j-1]=="#"){
				map[i][j]+=1;
              }
              if(map[i-1][j-1]=="#"){
				map[i][j]+=1;
              }
              
           	}
          }
		}
      
      
      for(int i=0;i<H;i++) {//データの書き出し
        for(int j=0;j<W-1;j++){
			System.out.print(map[i][j]);
        }
		System.out.println(map[i][W]);
	  }
      
    }
}


Compiler output:
Main.java:9: error: not a statement
        ststic public String[][] map;
        ^
Main.java:9: error: ';' expected
        ststic public String[][] map;
              ^
Main.java:9: error: illegal start of expression
        ststic public String[][] map;
               ^
Main.java:10: error: <identifier> expected
      	map=new String [H][W];
      	   ^
Main.java:13: error: illegal start of type
      	for(int i=0;i<H;i++) {//????????
      	^
Main.java:13: error: > or ',' expected
      	for(int i=0;i<H;i++) {//????????
      	               ^
Main.java:13: error: <identifier> expected
      	for(int i=0;i<H;i++) {//????????
      	                 ^
Main.java:19: error: illegal start of type
      	for(int i=0;i<H;i++) {//??
      	^
Main.java:19: error: > or ',' expected
      	for(int i=0;i<H;i++) {//??
      	               ^
Main.java:19: error: <identifier> expected
      	for(int i=0;i<H;i++) {//??
      	                 ^
Main.java:54: error: illegal start of type
      for(int i=0;i<H;i++) {//????????
      ^
Main.java:54: error: > or ',' expected
      for(int i=0;i<H;i++) {//????????
                     ^
Main.java:54: error: <identifier> expected
      for(int i=0;i<H;i++) {//????????
                       ^
Main.java:62: error: class, interface, enum, or record expected
}
^
14 errors
Language: C++

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

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

 
/*CODE START HERE*/
int main() {
  int h,w;
  cin >> h >> w;
  vector<string> s(h);
  for(int i= 0 ; i<h ; i++){
    cin >> s.at(i);
  }
  for (int i=0 ; i<h;i++){
    for(int j=0 ; j<w ; j++){
      if ( s.at(i).at(j)=='#') continue ;
      int  num = 0;
      for(int k=0; k<8;k++){
        const int nx = (j+dx[k]);
        const int ny = (i+dy[k]);
        
        if(ny<0 || h <=ny)continue;
        if(nx<0 || w<=nx)continue;
        if ( s.at(ny).at(nx) == '#'){
          num ++ ;
        }
        
      }
      
      s.at(ny).at(nx)= char(num + '0') ;
    }
  }
  for(int i=0 ;i<h ; i++){
    cout<< s.at(i) << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:12: error: 'ny' was not declared in this scope; did you mean 'yn'?
   32 |       s.at(ny).at(nx)= char(num + '0') ;
      |            ^~
      |            yn
a.cc:32:19: error: 'nx' was not declared in this scope; did you mean 'dx'?
   32 |       s.at(ny).at(nx)= char(num + '0') ;
      |                   ^~
      |                   dx
Language: C++

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

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

 
/*CODE START HERE*/
int main() {
  int h,w;
  cin >> h >> w;
  vector<string> s(h);
  for(int i= 0 ; i<h ; i++){
    cin >> s.at(i);
  }
  for (int i=0 ; i<h;i++){
    for(int j=0 ; j<w ; j++){
      if ( s.at(i).at(j)=='#') continue ;
      int  num = 0;
      for(int k=0; k<8;k++){
        int nx = (j+dx[k]);
        int ny = (i+dy[k]);
        
        if(ny<0 || h <=ny)continue;
        if(nx<0 || w<=nx)continue;
        if ( s.at(ny).at(nx) == '#'){
          num ++ ;
        }
        
      }
      
      s.at(ny).at(nx)= char(num + '0') ;
    }
  }
  for(int i=0 ;i<h ; i++){
    cout<< s.at(i) << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:12: error: 'ny' was not declared in this scope; did you mean 'yn'?
   32 |       s.at(ny).at(nx)= char(num + '0') ;
      |            ^~
      |            yn
a.cc:32:19: error: 'nx' was not declared in this scope; did you mean 'dx'?
   32 |       s.at(ny).at(nx)= char(num + '0') ;
      |                   ^~
      |                   dx
Language: C++

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

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

 
/*CODE START HERE*/
int main() {
  int h,w;
  cin >> h >> w;
  vector<string> s(h);
  for(int i= 0 ; i<h ; i++){
    cin >> s.at(i);
  }
  for (int i=0 ; i<h;i++){
    for(int j=0 ; j<w ; j++){
      if ( s.at(i).at(j)=='#') continue ;
      int  num = 0;
      for(int k=0; k<8;k++){
        int nx = (j+dx[k]);
        int ny = (i+dy[k]);
        
        if(ni<0orh<=ni)continue;
        if(nj<0orw<=nj)continue;
        if ( s.at(ny).at(nx) == '#'){
          num ++ ;
        }
        
      }
      
      s.at(ny).at(nx)= char(num + '0') ;
    }
  }
  for(int i=0 ;i<h ; i++){
    cout<< s.at(i) << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:12: error: 'ni' was not declared in this scope; did you mean 'ny'?
   24 |         if(ni<0orh<=ni)continue;
      |            ^~
      |            ny
a.cc:24:15: error: unable to find numeric literal operator 'operator""orh'
   24 |         if(ni<0orh<=ni)continue;
      |               ^~~~
a.cc:25:12: error: 'nj' was not declared in this scope; did you mean 'ny'?
   25 |         if(nj<0orw<=nj)continue;
      |            ^~
      |            ny
a.cc:25:15: error: unable to find numeric literal operator 'operator""orw'
   25 |         if(nj<0orw<=nj)continue;
      |               ^~~~
a.cc:32:12: error: 'ny' was not declared in this scope; did you mean 'yn'?
   32 |       s.at(ny).at(nx)= char(num + '0') ;
      |            ^~
      |            yn
a.cc:32:19: error: 'nx' was not declared in this scope; did you mean 'dx'?
   32 |       s.at(ny).at(nx)= char(num + '0') ;
      |                   ^~
      |                   dx
Language: C++

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

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

 
/*CODE START HERE*/
int main() {
  int h,w;
  cin >> h >> w;
  vector<string> s(h);
  for(int i= 0 ; i<h ; i++){
    cin >> s.at(i);
  }
  for (int i=0 ; i<h;i++){
    for(int j=0 ; j<w ; j++){
      if ( s.at(i).at(j)=='#') continue ;
      int  num = 0;
      for(int k=0; k<8;k++){
        int nx = (j+dx[k]);
        int ny = (i+dy[k]);
        
        if ( s.at(ny).at(nx) == '#'){
          num ++ ;
        }
        
      }
      s.at(ny).at(nx)= char(num + '0') ;
    }
  }
  for(int i=0 ;i<h ; i++){
    cout<< s.at(i) << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:12: error: 'ny' was not declared in this scope; did you mean 'yn'?
   29 |       s.at(ny).at(nx)= char(num + '0') ;
      |            ^~
      |            yn
a.cc:29:19: error: 'nx' was not declared in this scope; did you mean 'dx'?
   29 |       s.at(ny).at(nx)= char(num + '0') ;
      |                   ^~
      |                   dx
Language: C++

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

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

 
/*CODE START HERE*/
int main() {
  int h,w;
  cin >> h >> w;
  vector<string> s(h);
  for(int i= 0 ; i<h ; i++){
    cin >> s.at(i);
  }
  for (int i=0 ; i<h;i++){
    for(int j=0 ; j<w ; j++){
      if ( s.at(i).at(j)=='#') continue ;
      int  num = 0;
      for(int k=0; k<8;k++){
        int nx = (j+dx[k]);
        int ny = (i+dy[k]);
        
        if ( d.at(ny).at(nx) == '#'){
          num ++ ;
        }
        
      }
      s.at(ny).at(nx)= char(num + '0') ;
    }
  }
  for(int i=0 ;i<h ; i++){
    cout<< s.at(i) << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:14: error: 'd' was not declared in this scope
   24 |         if ( d.at(ny).at(nx) == '#'){
      |              ^
a.cc:29:12: error: 'ny' was not declared in this scope; did you mean 'yn'?
   29 |       s.at(ny).at(nx)= char(num + '0') ;
      |            ^~
      |            yn
a.cc:29:19: error: 'nx' was not declared in this scope; did you mean 'dx'?
   29 |       s.at(ny).at(nx)= char(num + '0') ;
      |                   ^~
      |                   dx
Language: C++

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

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

 
/*CODE START HERE*/
int main() {
  int h,w;
  cin >> h >> w;
  vector<string> s(h);
  for(int i= 0 ; i<h ; i++){
    cin >> s.at(i);
  }
  for (int i=0 ; i<h;i++){
    for(int j=0 ; j<w ; j++){
      if ( s.at(i).at(j)=='#') continue ;
      int  num = 0;
      for(int k=0; k<8;k++){
        int nx = (j+dx.at(k));
        int ny = (i+dy.at(k));
        
        if ( d.at(ny).at(nx) == '#'){
          num ++ ;
        }
        
      }
      s.at(ny).at(nx)= char(num + '0') ;
    }
  }
  for(int i=0 ;i<h ; i++){
    cout<< s(i) << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:24: error: request for member 'at' in 'dx', which is of non-class type 'const int [8]'
   21 |         int nx = (j+dx.at(k));
      |                        ^~
a.cc:22:24: error: request for member 'at' in 'dy', which is of non-class type 'const int [8]'
   22 |         int ny = (i+dy.at(k));
      |                        ^~
a.cc:24:14: error: 'd' was not declared in this scope
   24 |         if ( d.at(ny).at(nx) == '#'){
      |              ^
a.cc:29:12: error: 'ny' was not declared in this scope; did you mean 'yn'?
   29 |       s.at(ny).at(nx)= char(num + '0') ;
      |            ^~
      |            yn
a.cc:29:19: error: 'nx' was not declared in this scope; did you mean 'dx'?
   29 |       s.at(ny).at(nx)= char(num + '0') ;
      |                   ^~
      |                   dx
a.cc:33:13: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
   33 |     cout<< s(i) << endl;
      |            ~^~~
Language: C++

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

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

 
/*CODE START HERE*/
int main() {
  int h,w;
  cin >> h >> w;
  string s[h];
  for(int i= 0 ; i<h ; i++){
    cin >> s.at(i);
  }
  for (int i=0 ; i<h;i++){
    for(int j=0 ; j<w ; j++){
      if ( s.at(i).at(j)=='#') continue ;
      int  num = 0;
      for(int k=0; k<8;k++){
        int nx = (j+dx.at(k));
        int ny = (i+dy.at(k));
        
        if ( d.at(ny).at(nx) == '#'){
          num ++ ;
        }
        
      }
      s.at(ny).at(nx)= char(num + '0') ;
    }
  }
  for(int i=0 ;i<h ; i++){
    cout<< s(i) << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:14: error: request for member 'at' in 's', which is of non-class type 'std::string [h]' {aka 'std::__cxx11::basic_string<char> [h]'}
   14 |     cin >> s.at(i);
      |              ^~
a.cc:18:14: error: request for member 'at' in 's', which is of non-class type 'std::string [h]' {aka 'std::__cxx11::basic_string<char> [h]'}
   18 |       if ( s.at(i).at(j)=='#') continue ;
      |              ^~
a.cc:21:24: error: request for member 'at' in 'dx', which is of non-class type 'const int [8]'
   21 |         int nx = (j+dx.at(k));
      |                        ^~
a.cc:22:24: error: request for member 'at' in 'dy', which is of non-class type 'const int [8]'
   22 |         int ny = (i+dy.at(k));
      |                        ^~
a.cc:24:14: error: 'd' was not declared in this scope
   24 |         if ( d.at(ny).at(nx) == '#'){
      |              ^
a.cc:29:9: error: request for member 'at' in 's', which is of non-class type 'std::string [h]' {aka 'std::__cxx11::basic_string<char> [h]'}
   29 |       s.at(ny).at(nx)= char(num + '0') ;
      |         ^~
a.cc:29:12: error: 'ny' was not declared in this scope; did you mean 'yn'?
   29 |       s.at(ny).at(nx)= char(num + '0') ;
      |            ^~
      |            yn
a.cc:29:19: error: 'nx' was not declared in this scope; did you mean 'dx'?
   29 |       s.at(ny).at(nx)= char(num + '0') ;
      |                   ^~
      |                   dx
a.cc:33:13: error: 's' cannot be used as a function
   33 |     cout<< s(i) << endl;
      |            ~^~~
Language: C++

#include <iostream>
#include<vector>
#include<algorithm>
#include<math.h>
using namespace std;
int main() {
	int  h,w; cin >>h>>w;
	string board[51];
	int dx[8] = { -1,-1,-1, 0,0,1,1,1};
	int dy[8] = { -1,0,1,-1,1,-1,0,1};
	for (int i = 0; i < h; i++) cin >> board[i];
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			if (board[i][j] == '.') {
				int ans = 0;
				for (int k = 0; k < 8; k++) {
					int x = i + dx[k]; int y = j + dy[k];
					if (x>=0&&x<h&&y<w&&board[x][y]=='#'){ans++}
				}
				board[i][j] = 'o' + ans;
			}
		}
	}
	for (int i = 0; i < h; i++) { cout << board[i] << endl; }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:84: error: expected ';' before '}' token
   18 |                                         if (x>=0&&x<h&&y<w&&board[x][y]=='#'){ans++}
      |                                                                                    ^
      |                                                                                    ;
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];
  
  const int x[8]={1,1,1,0,-1,-1,-1,0};
  const int y[8]={-1,0,1,1,1,0,-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+x[d];
        const int nj =j+y[d];
        
        if (ni<0 || h<=ni) continue;
        if (nj<0 || w<=nj) continue;
        if (board[ni][nj]=='#') num++;
      }
      
      board[i][j]=itoa(num);
    }
  }
  
  for (int i=0; i<h; i++) cout << board[i] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:19: error: 'itoa' was not declared in this scope
   29 |       board[i][j]=itoa(num);
      |                   ^~~~
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];
  
  const int x[8]={1,1,1,0,-1,-1,-1,0};
  const int y[8]={-1,0,1,1,1,0,-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+x[d];
        const int nj =j+y[d];
        
        if (ni<0 || h<=ni) continue;
        if (nj<0 || w<=nj) continue;
        if (board[ni][nj]=='#') num++;
      }
      
      board[i][j]=to_string(num);
    }
  }
  
  for (int i=0; i<h; i++) cout << board[i] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:28: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} in assignment
   29 |       board[i][j]=to_string(num);
      |                   ~~~~~~~~~^~~~~
      |                            |
      |                            std::string {aka std::__cxx11::basic_string<char>}
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];
  
  const int x[8]={1,1,1,0,-1,-1,-1,0};
  const int y[8]={-1,0,1,1,1,0,-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+x[d];
        const int nj =j+y[x];
        
        if (ni<0 || h<=ni) continue;
        if (nj<0 || w<=nj) continue;
        if (board[ni][nj]=='#') num++;
      }
    }
  }
  
  for (int i=0; i<h; i++) cout << board[i] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:26: error: invalid types 'const int [8][const int [8]]' for array subscript
   22 |         const int nj =j+y[x];
      |                          ^
Language: C++

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

int main() {
  int dx[8]={1,1,1,0,0,-1,-1,-1};
  int dy[8]={1,0,-1,1,-1,1,0,-1};
  int H,W ;
  cin >> H >> W ;
  string S[H];
  for (int i=0;i<H;i++) cin >> S[i];
  for (int i=0;i<H;i++) {
    for (int j=0;j<W;j++) {
      if(S[i][j]=='.') {
        int count=0;
        for (int k=0;k<8;k++) {
          int x=i+dx[k];
          int y=j+dy[k];
          if (0<=x &&x<H &&0<=y&&y<W&&S[x][y]='#') count++;
        }
        S[i][j]='0'+count ;
      }
    }
  }
  for (int i=0,i<H,i++) cout << S[i] <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:37: error: lvalue required as left operand of assignment
   18 |           if (0<=x &&x<H &&0<=y&&y<W&&S[x][y]='#') count++;
a.cc:24:17: error: expected ';' before '<' token
   24 |   for (int i=0,i<H,i++) cout << S[i] <<endl;
      |                 ^
      |                 ;
a.cc:24:17: error: expected primary-expression before '<' token
a.cc:24:23: error: expected ';' before ')' token
   24 |   for (int i=0,i<H,i++) cout << S[i] <<endl;
      |                       ^
      |                       ;
Language: C++

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

int main() {
  int dx[8]={1,1,1,0,0,-1,-1,-1};
  int dy[8]={1,0,-1,1,-1,1,0,-1};
  int H,W ;
  cin >> H >> W ;
  string S[H];
  for (int i=0;i<H;i++) cin >> S[i][j];
  for (int i=0;i<H;i++) {
    for (int j=0;j<W;j++) {
      if(S[i][j]=='.') {
        int count=0;
        for (int k=0;k<8;k++) {
          int x=i+dx[k];
          int y=j+dy[k];
          if (0<=x &&x<H &&0<=y&&y<W&&S[x][y]='#') count++;
        }
        S[i][j]='0'+count ;
      }
    }
  }
  for (int i=0,i<H,i++) cout << S[i] <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:37: error: 'j' was not declared in this scope
   10 |   for (int i=0;i<H;i++) cin >> S[i][j];
      |                                     ^
a.cc:18:37: error: lvalue required as left operand of assignment
   18 |           if (0<=x &&x<H &&0<=y&&y<W&&S[x][y]='#') count++;
a.cc:24:17: error: expected ';' before '<' token
   24 |   for (int i=0,i<H,i++) cout << S[i] <<endl;
      |                 ^
      |                 ;
a.cc:24:17: error: expected primary-expression before '<' token
a.cc:24:23: error: expected ';' before ')' token
   24 |   for (int i=0,i<H,i++) cout << S[i] <<endl;
      |                       ^
      |                       ;
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdlib>
 
using namespace std;
 
 
 
int main() {
	
	int h, w;
	cin >> h >> w;
 
	vector<string> s(50);
 
	for (int i = 0; i < h; i++) {
		cin >> s.at(i);
	}
 
	vector<int> x{ 1, 0, -1, 1, 0, -1, 1, -1 };
	vector<int> y{ 1, 1, 1, -1, -1, -1, 0, 0 };
 
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			if (s.at(i).at(j) == '#') continue;
 
			int dx;
			int dy;
			int num = 0;
			for (int k = 0; k < 8; k++) {
				dx = x.at(k);
				dy = y.at(k);
 
 
				int a = i + dx;
				int b = j + dy;
 
				if (a >= h || a < 0) continue;
				if (b >= w || b < 0) continue;
				if (s.at(a).at(b) == '#') ++num;
			}
			s.at(i).at(j) = num + '0';
		}
	}
 
	for (int i = 0; i < h; i++) {
		cout << s.at(i) << endl;
	}
 
	return 0;
}
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdlib>

using namespace std;



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

	vector<string> s(50);

	for (int i = 0; i < h; i++) {
		cin >> s.at(i);
	}

	vector<int> x{ 1, 0, -1, 1, 0, -1, 1, -1 };
	vector<int> y{ 1, 1, 1, -1, -1, -1, 0, 0 };

	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			if (s.at(i).at(j) == '#') continue;

			int dx;
			int dy;
			int num = 0;
			for (int k = 0; k < 8; k++) {
				dx = x.at(k);
				dy = y.at(k);


				int a = i + dx;
				int b = j + dy;

				if (a >= h || a < 0) continue;
				if (b >= w || b < 0) continue;
				if (s.at(a).at(b) == '#') ++num;
			}
			s.at(i).at(j) = num + '0';
		}
	}

	for (int i = 0; i < h; i++) {
		cout << s.at(i) << endl;
	}

	return 0;
}


Compiler output:
a.cc:64:5: error: redefinition of 'int main()'
   64 | int main() {
      |     ^~~~
a.cc:11:5: note: 'int main()' previously defined here
   11 | int main() {
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int H,W;
  cin >> H >> W ;
  for (int i=0 ; i < H*W ; i++){
    for (int i=0 ; i < H*W ; i++){
    char s[i];
      cin >> s[i];
  }
      if (s[i] != '#'){
        int n = 0 ;
          if ( i-W-1 <0){
          if (s[i-W-1]=='#'){
            n++;
          }
          }
        if ( i-W <0){
        if (s[i-W]=='#'){
            n++;
          }
        }
          if ( i-W+1 <0){
        if (s[i-W+1]=='#'){
            n++;
          }
          }
        if ( i-1 <0){
        if (s[i-1]=='#'){
            n++;
          }
        }
        if ( i+1 <H*W){
        if (s[i+1]=='#'){
            n++;
          }
        }
        if ( i+W-1 <H*W){
        if (s[i+W-1]=='#'){
            n++;
          }
        }
        if ( i+W <H*W){
        if (s[i+W]=='#'){
            n++;
          }
        }
        if ( i+W+1 <H*W){ 
        if (s[i+W+1]=='#'){
            n++;
          }
        }
      cout << n ;
      }
      else if (s[i]=='#'){
        cout << '#' ;
      }
      if ( (i+1)%W==0  ){
        cout << endl ;
      }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:11: error: 's' was not declared in this scope
   12 |       if (s[i] != '#'){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int H,W;
  cin >> H >> W ;
  for (int i=0 ; i < H*W ; i++){
    char s[i];
      cin >> s[i];
      if (s[i] != '#'){
        int n[i];
          if ( i-W-1 <0){
          if (s[i-W-1]=='#'){
            n[i]++;
          }
          }
        if ( i-W <0){
        if (s[i-W]=='#'){
            n[i]++;
          }
        }
          if ( i-W+1 <0){
        if (s[i-W+1]=='#'){
            n[i]++;
          }
          }
        if ( i-1 <0){
        if (s[i-1]=='#'){
            n[i]++;
          }
        }
        if ( i+1 <H*W){
        if (s[i+1]=='#'){
            n[i]++;
          }
        }
        if ( i+W-1 <H*W){
        if (s[i+W-1]=='#'){
            n[i]++;
          }
        }
        if ( i+W <H*W){
        if (s[i+W]=='#'){
            n[i]++;
          }
        }
        if ( i+W+1 <H*W){ 
        if (s[i+W+1]=='#'){
            n[i]++;
          }
        }
      cout << n[i] ;
      }
      else if (s[i]=='#'){
        cout << '#' ;
      }
      if ( (i+1)%W=0  ){
        endl ;
      }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:17: error: lvalue required as left operand of assignment
   57 |       if ( (i+1)%W=0  ){
      |            ~~~~~^~
a.cc:58:14: error: statement cannot resolve address of overloaded function
   58 |         endl ;
      |              ^
Language: C++

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

int main()
{
  int W, H, i;
  char s;
  string S = "";
  string field = "":
  
  cin >> H, W;
  for(i = 0; i < H + W; i++)
  {
    cin >> s;
    S += s;
  }
  for(i = 0; i < H + W; i++)
  {
    if(S.at(i) == '.')
    {
      int cnt = 0;
      int pos1 = i - (W + 1);
      int pos2 = i - W;
      int pos3 = i - (W - 1);
      int pos4 = i - 1;
      int pos5 = i + 1;
      int pos6 = i + (W + 1);
      int pos7 = i + W;
      int pos8 = i + (W - 1);
      if(pos1 > 0 && i % W != 0)
      {
      	if(S.at(pos1) == '#')
      	{
        	cnt += 1;
      	}
      }
      if(pos2 > 0)
      {
      	if(S.at(pos2) == '#')
      	{
        	cnt += 1;
      	}
      }
      if(pos3 > 0 && pos3 % W != W-1)
      {
      	if(S.at(pos3) == '#')
      	{
        	cnt += 1;
      	}
      }
      if(pos4 > 0 && i % W != 0)
      {
      	if(S.at(pos4) == '#')
      	{
        	cnt += 1;
      	}
      }
      if(pos5 >= W+H && pos5 % W != W -1)
      {
      	if(S.at(pos5) == '#')
      	{
        	cnt += 1;
      	}
      }
      if(pos6 >= W+H && pos6 % W != W -1)
      {
      	if(S.at(pos6) == '#')
      	{
        	cnt += 1;
      	}
      }
      if(pos7 >= W+H)
      {
      	if(S.at(pos7) == '#')
      	{
        	cnt += 1;
      	}
      }
      if(pos8 >= W+H && i % W != 0)
      {
      	if(S.at(pos8) == '#')
      	{
        	cnt += 1;
      	}
      }
      field += (char)(cnt);
    }
    else
    {
      field += '#';
    }
  }
  for(i=0; i<M+H; i++)
  {
    cout << field.at(i);
    if(i % W == W - 1)
    {
      cout << endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: expected ',' or ';' before ':' token
    9 |   string field = "":
      |                    ^
a.cc:93:14: error: 'M' was not declared in this scope
   93 |   for(i=0; i<M+H; i++)
      |              ^
Language: C

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


int main(){
    int H, W;
    int count;

    cin >> H;
    cin >> W;

    char S[H][W];

    rep(i, H)
    {
        cin >> S[i];
    }

    rep(i, H)
    {
        rep(j, W){
            if (S[i][j] == '.'){
                count = 0;
                for (int k = -1; k < 2; k++)
                {
                    if((i + k > 0) && (i + k < H - 1)){
                        for (int l = -1; l < 2; l++)
                        {
                            if((j + l > 0) && (j + l < W - 1)){
                                if((k == 0) && (l == 0)){
                                }else{
                                    if(S[i + k][j + l] == '#') count++;
                                }
                            }
                        }
                    }
                }

                cout << count;
            }else{
                cout << '#';
            }
        }
        cout << endl;
    }

    return 0;
}

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

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

int main() {
  
  //初期宣言
  int H,W;
  //HとWを読み込み
  cin >> H >>W;

  //H×Wのdataとout用の行列を定義する
  vector<vector<char>>data(H,vector<char>(W));
  
  for(int i = 0; i < H; i++ ){
    for(j = 0; j < W; j++){
		cin >> data.at(i).at(j);      
    }
  }
  
  //判定用
  for(int i = 0; i < H; i++ ){
        
    for(j = 0; j < W; j++){
       
       //地雷かどうかの判定
       if( data.at(i).data(j) == '#'){
         cout << '#' ;
       }
       
       //地雷出ない場合の周りの地雷の数を数えるプログラム
       else if( data.at(i).data(j) == '.' ){
         
         //回答用のdataを宣言
         int A=0;
               
      	//左上用
		if(i != 0 || j != 0){
          if(data.at(i-1).at(j-1)=='#'){
           	A++; 
          }
        }
        //左上用
		if(i != 0 || j != 0){
          if(data.at(i-1).at(j-1)=='#'){
           	A++; 
          }
        }
         
        //真ん中上用
		if(i != 0){
          if(data.at(i-1).at(j)=='#'){
           	A++; 
          }
        }
         
        //右上用
		if(i != 0 || j != W-1){
          if(data.at(i-1).at(j+1) == '#'){
           	A++; 
          }
        }
         
        //左横用
		if(j != 0){
          if(data.at(i).at(j-1) == '#'){
           	A++; 
          }
        }
         
        //右横用
		if(j != W-1){
          if(data.at(i).at(j+1)=='#'){
           	A++; 
          }
        }
         
        //左下用
		if(i != H-1 || j != 0){
          if(data.at(i+1).at(j-1) == '#'){
           	A++; 
          }
        }
         
        //真ん中下用
		if(i != H-1){
          if(data.at(i+1).at(j) == '#'){
           	A++; 
          }
        }
        
        //右下用
		if(i != H-1 || j != W-1){
          if(data.at(i+1).at(j+1) == '#'){
           	A++; 
          }
        }
         
        //結果を出力 
        cout << A ;
       }
      
     else{
       cout << "error" << endl;
     }
      
    }
    //改行用
    cout << endl;
  }
  
  
}


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

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

int main () {
    int H, W;
    cin >> H >> W;
    vector <string>A(H), B(W);
    for (int i=0; i<H; i++) {
        cin >> A.at(i) >> B.at(i);
    }

    vector <vector<char>> date(H, vector<char>(W, '#'));
    
    for (int i=0; i<H+1; i++) {
        if (


Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: expected primary-expression at end of input
   15 |         if (
      |             ^
a.cc:15:13: error: expected ')' at end of input
   15 |         if (
      |            ~^
      |             )
a.cc:15:13: error: expected statement at end of input
a.cc:15:13: error: expected '}' at end of input
a.cc:14:31: note: to match this '{'
   14 |     for (int i=0; i<H+1; i++) {
      |                               ^
a.cc:15:13: error: expected '}' at end of input
   15 |         if (
      |             ^
a.cc:4:13: note: to match this '{'
    4 | int main () {
      |             ^
Language: C++

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

int main(){
	int h,w; cin>>h>>w;
	vector<vector<char>> v(h,vector<char>(w));
	rep(i,h){
		string s; cin>>s;
		rep(j,w){
			v[i][j]=s[j];
		}
	}
	vector<vector<string>> a(h,vector<string>(w,"#"));
	rep(i,h){
		rep(j,w){
			int cnt=0;
			for(int k=-1; k<2; k++){
				for(int l=-1; l<2; l++){
					if(i+k<0||j+l<0||i+k>=h||j+l>=w) continue;
					else if(k==0&&l==0) continue;
					else if(v[i+k][j+l]=='#') cnt++;
				}
			}
			if(v[i][j]=='#') continue;
			else a[i][j]=to_string(cnt);
		}
	}
	rep(i,h){
		rep(i,j){cout<<a[i][j];}
		cout<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:23: error: 'j' was not declared in this scope
   30 |                 rep(i,j){cout<<a[i][j];}
      |                       ^
a.cc:3:34: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(int i=0; i<(n); i++)
      |                                  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int h,w;
    cin >> h >> w;
    char c[h][w];
    for(int i=0;i<h;i++)for(int j=0;j<w;j++)cin >> c[i][j];
    dy[8]={-1,-1,-1,0,0,1,1,1};
    dx[8]={-1,0,1,-1,1,-1,0,1};
    for(int i=0;i<h;i++)for(int j=0;j<w;j++){
        if(c[i][j]=='#')cout << "#";
        else{
            int tmp=0;
            for(int k=0;k<8;k++){
                if(i+dy[k]>=0 && i+dy[k]<h && j+dx[k]>=0 && j+dx[k]<w){
                    if(c[i+dy[k]][j+dx[k]]=='#')tmp++;
                }
            }
            cout << tmp;
        }
        cout << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'dy' was not declared in this scope
    8 |     dy[8]={-1,-1,-1,0,0,1,1,1};
      |     ^~
a.cc:9:5: error: 'dx' was not declared in this scope
    9 |     dx[8]={-1,0,1,-1,1,-1,0,1};
      |     ^~
Language: C++

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

int main () {
    int H, W;
    cin >> H >> W;
    string S;
    for (int i=0; i<H; i++) {
        cin >> S;
    }
    if (S
        

Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: expected ')' at end of input
   11 |     if (S
      |        ~ ^
      |          )
a.cc:11:9: error: could not convert 'S' from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool'
   11 |     if (S
      |         ^
      |         |
      |         std::string {aka std::__cxx11::basic_string<char>}
a.cc:11:10: error: expected statement at end of input
   11 |     if (S
      |          ^
a.cc:11:10: error: expected '}' at end of input
a.cc:4:13: note: to match this '{'
    4 | int main () {
      |             ^
Language: C++

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

int main() {
  int a,b,c,d,e,f,g,h,i,j,k,l,m;
  /*   f  g  h
       i  x  j
       k  l  m
  */
  c=1;
  cin >> a >> b;
  string stra,strb;
  cin >> stra/*一行目*/ >> strb/*二行目*/;
  //(一列目始め)-----------------------------------------------------------------
  //(一列目ー１始め)==============================================================
  if (stra.at(1)=="."){
    d = stra.at(2);
    e = strb.at(1);
    if (d==# || e==#) {
      if (d==# && e==#) {
        stra.at(1) = 2;
      }
      else {
        stra.at(1) = 1;
      }
    }
    else {
      stra.at(1) = 0;
    }
  }
  //(一列目ー１終わり)============================================================
  for (int i = 0;i<b-2;i++) {
    c++;
    if (stra.at(c)=="."){
      
      
    }
    if ()
  }
  //(一列目終わり)--------------------------------------------------------------
  for (int i = 0; i < a-2; i++) {
    
  }
  
  
}



Compiler output:
a.cc:19:12: error: stray '#' in program
   19 |     if (d==# || e==#) {
      |            ^
a.cc:19:20: error: stray '#' in program
   19 |     if (d==# || e==#) {
      |                    ^
a.cc:20:14: error: stray '#' in program
   20 |       if (d==# && e==#) {
      |              ^
a.cc:20:22: error: stray '#' in program
   20 |       if (d==# && e==#) {
      |                      ^
a.cc: In function 'int main()':
a.cc:16:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |   if (stra.at(1)=="."){
      |       ~~~~~~~~~~^~~~~
a.cc:19:14: error: expected primary-expression before '||' token
   19 |     if (d==# || e==#) {
      |              ^~
a.cc:19:21: error: expected primary-expression before ')' token
   19 |     if (d==# || e==#) {
      |                     ^
a.cc:20:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   20 |       if (d==# && e==#) {
      |           ~^~~~~~~~
a.cc:20:23: error: expected primary-expression before ')' token
   20 |       if (d==# && e==#) {
      |                       ^
a.cc:34:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   34 |     if (stra.at(c)=="."){
      |         ~~~~~~~~~~^~~~~
a.cc:38:9: error: expected primary-expression before ')' token
   38 |     if ()
      |         ^
a.cc:39:3: error: expected primary-expression before '}' token
   39 |   }
      |   ^
a.cc:20:19: error: label 'e' used but not defined
   20 |       if (d==# && e==#) {
      |                   ^