Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
    string Sa,Sb,Sc,MANNAKA;
	int TATE=0  , tate, YOKO=0 , LOOK = 0 ,sum= 0;
    cin >> TATE >> YOKO >>Sa ;
    tate = TATE;

    
    for (int tate = 0; tate  < TATE ;tate++)
   
     LOOK = 1;
     Sa = Sb;
     Sb = Sc;

       for (LOOK < YOKO;LOOK++){
    
  
  if ( tate == 0){
    MANNAKA = ".";
    Sa = "." + MANNAKA + ".";
    }else{
    cin >> Sc;
  
    
    
    
    
    char A,B,C,D,E,F,G,H,I,Cn;
    A = Sa.at(LOOK);
    B = Sa.at(LOOK+1);
    C = Sa.at(LOOK+2);
    D = Sb.at(LOOK);
    E = Sb.at(LOOK+1);
    F = Sb.at(LOOK+2);
    G = Sc.at(LOOK);
    H = Sc.at(LOOK+1);
    I = Sc.at(LOOK+2);
  
  
     if (E == '#'){
    OUT = '#';
    }else{
    if (A == '#'){
    sum++;
    }
     if (B == '#'){
    sum++;
    }if (C == '#'){
    sum++;
    }if (D == '#'){
    sum++;
    }if (F == '#'){
    sum++;
    }if (G == '#'){
    sum++;
    }if (H == '#'){
    sum++;
    }if (I == '#'){
    sum++;
    }
    if (sum == 0){
    OUT = '0';
    }else if (sum == 1){
    OUT = '1';
    }else if (sum == 2){
    OUT = '2';
    }else if (sum == 3){
    OUT = '3';
    }else if (sum == 4){
    OUT = '4';
    }else if (sum == 5){
    OUT = '5';
    }else if (sum == 6){
    OUT = '6';
    }else if (sum == 7){
    OUT = '7';
    }else if (sum == 8){
    OUT = '8';
    }

    cout << OUT

Compiler output:
a.cc: In function 'int main()':
a.cc:17:31: error: expected ';' before ')' token
   17 |        for (LOOK < YOKO;LOOK++){
      |                               ^
      |                               ;
a.cc:43:5: error: 'OUT' was not declared in this scope
   43 |     OUT = '#';
      |     ^~~
a.cc:64:5: error: 'OUT' was not declared in this scope
   64 |     OUT = '0';
      |     ^~~
a.cc:66:5: error: 'OUT' was not declared in this scope
   66 |     OUT = '1';
      |     ^~~
a.cc:68:5: error: 'OUT' was not declared in this scope
   68 |     OUT = '2';
      |     ^~~
a.cc:70:5: error: 'OUT' was not declared in this scope
   70 |     OUT = '3';
      |     ^~~
a.cc:72:5: error: 'OUT' was not declared in this scope
   72 |     OUT = '4';
      |     ^~~
a.cc:74:5: error: 'OUT' was not declared in this scope
   74 |     OUT = '5';
      |     ^~~
a.cc:76:5: error: 'OUT' was not declared in this scope
   76 |     OUT = '6';
      |     ^~~
a.cc:78:5: error: 'OUT' was not declared in this scope
   78 |     OUT = '7';
      |     ^~~
a.cc:80:5: error: 'OUT' was not declared in this scope
   80 |     OUT = '8';
      |     ^~~
a.cc:83:13: error: 'OUT' was not declared in this scope
   83 |     cout << OUT
      |             ^~~
a.cc:83:16: error: expected '}' at end of input
   83 |     cout << OUT
      |                ^
a.cc:44:10: note: to match this '{'
   44 |     }else{
      |          ^
a.cc:83:16: error: expected '}' at end of input
   83 |     cout << OUT
      |                ^
a.cc:23:10: note: to match this '{'
   23 |     }else{
      |          ^
a.cc:83:16: error: expected '}' at end of input
   83 |     cout << OUT
      |                ^
a.cc:17:32: note: to match this '{'
   17 |        for (LOOK < YOKO;LOOK++){
      |                                ^
a.cc:83:16: error: expected '}' at end of input
   83 |     cout << OUT
      |                ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^