Language: C++

using System;
class A{
    static void Main(){
        while(true){
            string poikas=Console.ReadLine();
            if(poikas==null){break;}
            var shiki=poikas.Split('=');
            var ko=shiki.Split('+');
            var left=ko[0],right=ko[1],ans=ko[2];
            for(int i=0;i<10;i++){
                string Left="",Right="",Ans="";
                string tasu=i.ToString();
                for(int j=0;j<left.Length;j++){
                    if(left[j]=='X'){
                        Left+=tasu;
                    }
                    else{
                        Left+=left[j];
                    }
                }
                for(int j=0;j<right.Length;j++){
                    if(right[j]=='X'){
                        Right+=tasu;
                    }
                    else{
                        Right+=right[j];
                    }
                }
                for(int j=0;j<ans.Length;j++){
                    if(ans[j]=='X'){
                        Ans+=tasu;
                    }
                    else{
                        Ans+=ans[j];
                    }
                }
                if(int.Parse(Left)+int.Parse(Right)==int.Parse(Ans)){
                    Console.WriteLine(i);break;
                }
                if(i==9)
                {Console.WriteLine("NA");}                
            }
        }
    }
}


Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:45:2: error: expected ';' after class definition
   45 | }
      |  ^
      |  ;
a.cc: In static member function 'static void A::Main()':
a.cc:5:13: error: 'string' was not declared in this scope
    5 |             string poikas=Console.ReadLine();
      |             ^~~~~~
a.cc:6:16: error: 'poikas' was not declared in this scope
    6 |             if(poikas==null){break;}
      |                ^~~~~~
a.cc:6:24: error: 'null' was not declared in this scope
    6 |             if(poikas==null){break;}
      |                        ^~~~
a.cc:7:13: error: 'var' was not declared in this scope
    7 |             var shiki=poikas.Split('=');
      |             ^~~
a.cc:8:17: error: expected ';' before 'ko'
    8 |             var ko=shiki.Split('+');
      |                 ^~
a.cc:9:17: error: expected ';' before 'left'
    9 |             var left=ko[0],right=ko[1],ans=ko[2];
      |                 ^~~~
a.cc:11:24: error: expected ';' before 'Left'
   11 |                 string Left="",Right="",Ans="";
      |                        ^~~~
a.cc:12:24: error: expected ';' before 'tasu'
   12 |                 string tasu=i.ToString();
      |                        ^~~~
a.cc:13:31: error: 'left' was not declared in this scope
   13 |                 for(int j=0;j<left.Length;j++){
      |                               ^~~~
a.cc:15:25: error: 'Left' was not declared in this scope
   15 |                         Left+=tasu;
      |                         ^~~~
a.cc:15:31: error: 'tasu' was not declared in this scope
   15 |                         Left+=tasu;
      |                               ^~~~
a.cc:18:25: error: 'Left' was not declared in this scope
   18 |                         Left+=left[j];
      |                         ^~~~
a.cc:21:31: error: 'right' was not declared in this scope
   21 |                 for(int j=0;j<right.Length;j++){
      |                               ^~~~~
a.cc:23:25: error: 'Right' was not declared in this scope
   23 |                         Right+=tasu;
      |                         ^~~~~
a.cc:23:32: error: 'tasu' was not declared in this scope
   23 |                         Right+=tasu;
      |                                ^~~~
a.cc:26:25: error: 'Right' was not declared in this scope
   26 |                         Right+=right[j];
      |                         ^~~~~
a.cc:29:31: error: 'ans' was not declared in this scope
   29 |                 for(int j=0;j<ans.Length;j++){
      |                               ^~~
a.cc:31:25: error: 'Ans' was not declared in this scope
   31 |                         Ans+=tasu;
      |                         ^~~
a.cc:31:30: error: 'tasu' was not declared in this scope
   31 |                         Ans+=tasu;
      |                              ^~~~
a.cc:34:25: error: 'Ans' was not declared in this scope
   34 |                         Ans+=ans[j];
      |                         ^~~
a.cc:37:23: error: expected unqualified-id before '.' token
   37 |                 if(int.Parse(Left)+int.Parse(Right)==int.Parse(Ans)){
      |                       ^
a.cc:38:21: error: 'Console' was not declared in this scope
   38 |                     Console.WriteLine(i);break;
      |                     ^~~~~~~
a.cc:41:18: error: 'Console' was not declared in this scope
   41 |                 {Console.WriteLine("NA");}
      |                  ^~~~~~~