Language: C

#include<stdio.h>

int main(void){
    int H,W;
    int i,j
    int count=0;
        
    //入力の読み込み
    scanf("%d %d",&H,&W);    
    
    char matrix[H-1][W-1];
    
    for(i=0;i<H-1;i++){
        for(j=0;j<W-1;j++){
            scanf("%s",matrix[i][j]);
        }
    }
    
    //入力の格納
    for(i=0;i<H-1;i++){
        for(j=0;j<W-1;j++){
            if(matrix[i][j]==.){
                if(matrix[i-1][j-1]==#){
                    counut++;
                }
                if(matrix[i-1][j]==#){
                    count++;
                }
                if(matrix[i-1][j+1]==#){
                    count++;
                }
                if(matrix[i][j-1]==#){
                    count++;
                }
                if(matrix[i][j+1]==#){
                    count++;
                }
                if(matrix[i+1][j-1]==#){
                    count++;
                }
                if(matrix[i+1][j]==#){
                    count++;
                }
                if(matrix[i+1][j+1]==#){
                    count++;
                }
                matrix[i][j]=count;
            }
        }
    }
    
    //出力
    for(i=0;i<H-1;i++){
        for(j=0;j<W-1;j++){
            printf("%s",matrix[i][j]);
        }
        printf("\n");
    }
    
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:5: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
    6 |     int count=0;
      |     ^~~
main.c:14:13: error: 'j' undeclared (first use in this function)
   14 |         for(j=0;j<W-1;j++){
      |             ^
main.c:14:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:22:30: error: expected expression before '.' token
   22 |             if(matrix[i][j]==.){
      |                              ^
main.c:23:38: error: stray '#' in program
   23 |                 if(matrix[i-1][j-1]==#){
      |                                      ^
main.c:23:39: error: expected expression before ')' token
   23 |                 if(matrix[i-1][j-1]==#){
      |                                       ^
main.c:24:21: error: 'counut' undeclared (first use in this function)
   24 |                     counut++;
      |                     ^~~~~~
main.c:26:36: error: stray '#' in program
   26 |                 if(matrix[i-1][j]==#){
      |                                    ^
main.c:26:37: error: expected expression before ')' token
   26 |                 if(matrix[i-1][j]==#){
      |                                     ^
main.c:27:21: error: 'count' undeclared (first use in this function)
   27 |                     count++;
      |                     ^~~~~
main.c:29:38: error: stray '#' in program
   29 |                 if(matrix[i-1][j+1]==#){
      |                                      ^
main.c:29:39: error: expected expression before ')' token
   29 |                 if(matrix[i-1][j+1]==#){
      |                                       ^
main.c:32:36: error: stray '#' in program
   32 |                 if(matrix[i][j-1]==#){
      |                                    ^
main.c:32:37: error: expected expression before ')' token
   32 |                 if(matrix[i][j-1]==#){
      |                                     ^
main.c:35:36: error: stray '#' in program
   35 |                 if(matrix[i][j+1]==#){
      |                                    ^
main.c:35:37: error: expected expression before ')' token
   35 |                 if(matrix[i][j+1]==#){
      |                                     ^
main.c:38:38: error: stray '#' in program
   38 |                 if(matrix[i+1][j-1]==#){
      |                                      ^
main.c:38:39: error: expected expression before ')' token
   38 |                 if(matrix[i+1][j-1]==#){
      |                                       ^
main.c:41:36: error: stray '#' in program
   41 |                 if(matrix[i+1][j]==#){
      |                                    ^
main.c:41:37: error: expected expression before ')' token
   41 |                 if(matrix[i+1][j]==#){
      |                                     ^
main.c:44:38: error: stray '#' in program
   44 |                 if(matrix[i+1][j+1]==#){
      |                                      ^
main.c:44:39: error: expected expression before ')' token
   44 |                 if(matrix[i+1][j+1]==#){
      |                                       ^