Language: C++

int main(){
    string s;
    string t;
    string temp;
    
    
    getline(cin,s);
    while(s.length()==0){
        getline(cin,temp);
    }
    getline(cin,t);

    int len_s=s.length();
    int len_t=t.length();
    vector<vector<string> > vec( len_s+1 , vector<string> (len_t+1, ""));

    for(int i=1;i<=len_s;i++){
        for(int j=1;j<=len_t;j++){
            string temp1;
            if(s[i-1]==t[j-1]){
                temp1=vec[i-1][j-1]+s[i-1];
            }
            string temp2=vec[i-1][j];
            string temp3=vec[i][j-1];
            int len1=temp1.length();
            int len2=temp2.length();
            int len3=temp3.length();
            string pre_final=(len1>len2)?temp1:temp2;
            string final_s=(pre_final.length()>len3)?pre_final:temp3;
            vec[i][j]=final_s;
        }
    }
    cout<<vec[len_s][len_t];

   
    //cout<<LCS(len_s,len_t,0,0,s,t,vec);

}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:5: error: 'string' was not declared in this scope
    2 |     string s;
      |     ^~~~~~
a.cc:3:11: error: expected ';' before 't'
    3 |     string t;
      |           ^~
      |           ;
a.cc:4:11: error: expected ';' before 'temp'
    4 |     string temp;
      |           ^~~~~
      |           ;
a.cc:7:13: error: 'cin' was not declared in this scope
    7 |     getline(cin,s);
      |             ^~~
a.cc:7:17: error: 's' was not declared in this scope
    7 |     getline(cin,s);
      |                 ^
a.cc:7:5: error: 'getline' was not declared in this scope
    7 |     getline(cin,s);
      |     ^~~~~~~
a.cc:9:21: error: 'temp' was not declared in this scope
    9 |         getline(cin,temp);
      |                     ^~~~
a.cc:11:17: error: 't' was not declared in this scope
   11 |     getline(cin,t);
      |                 ^
a.cc:15:5: error: 'vector' was not declared in this scope
   15 |     vector<vector<string> > vec( len_s+1 , vector<string> (len_t+1, ""));
      |     ^~~~~~
a.cc:15:27: error: expected primary-expression before '>' token
   15 |     vector<vector<string> > vec( len_s+1 , vector<string> (len_t+1, ""));
      |                           ^
a.cc:15:29: error: 'vec' was not declared in this scope
   15 |     vector<vector<string> > vec( len_s+1 , vector<string> (len_t+1, ""));
      |                             ^~~
a.cc:19:19: error: expected ';' before 'temp1'
   19 |             string temp1;
      |                   ^~~~~~
      |                   ;
a.cc:21:17: error: 'temp1' was not declared in this scope
   21 |                 temp1=vec[i-1][j-1]+s[i-1];
      |                 ^~~~~
a.cc:23:19: error: expected ';' before 'temp2'
   23 |             string temp2=vec[i-1][j];
      |                   ^~~~~~
      |                   ;
a.cc:24:19: error: expected ';' before 'temp3'
   24 |             string temp3=vec[i][j-1];
      |                   ^~~~~~
      |                   ;
a.cc:25:22: error: 'temp1' was not declared in this scope
   25 |             int len1=temp1.length();
      |                      ^~~~~
a.cc:26:22: error: 'temp2' was not declared in this scope
   26 |             int len2=temp2.length();
      |                      ^~~~~
a.cc:27:22: error: 'temp3' was not declared in this scope
   27 |             int len3=temp3.length();
      |                      ^~~~~
a.cc:28:19: error: expected ';' before 'pre_final'
   28 |             string pre_final=(len1>len2)?temp1:temp2;
      |                   ^~~~~~~~~~
      |                   ;
a.cc:29:19: error: expected ';' before 'final_s'
   29 |             string final_s=(pre_final.length()>len3)?pre_final:temp3;
      |                   ^~~~~~~~
      |                   ;
a.cc:30:23: error: 'final_s' was not declared in this scope
   30 |             vec[i][j]=final_s;
      |                       ^~~~~~~
a.cc:33:5: error: 'cout' was not declared in this scope
   33 |     cout<<vec[len_s][len_t];
      |     ^~~~