Language: C++

#include<stdio.h>
#include<string>
#include<algorithm>
using namespase std;
static const int N = 1000;

int lcs(string X, string Y){
  int c[N + 1][N + 1];
  int m = X.size();
  int n = Y.size();
  int maxl = 0;
  X = ' ' + X;
  Y = ' ' + Y;
  for( int i = 1; i <= m; i++) c[i][0] = 0;
  for( int j = 1; j <= n; j++) c[0][j] = 0;

  for( int i = 1; i <= m; i++){
    for( int j = 1; j <= n; j++){
      if( X[i] == Y[j] ){
        c[i][j] = c[i -1][j - 1] + 1;
       } else {
       c[i][j] = max(c[i -1][j], c[i][j - 1]);
       }
       maxl = max(maxl, c[i][j];
     }
  }

  return maxl;
}


int main(){
  string s1, s2;
  int n; cin >> n;
  for( int i = 0; i < n; i++){
    cin >> s1 >> s2;
    cout << lcs(s1, s2) << endl;
  }
  
  return 0;
}

Compiler output:
a.cc:4:7: error: expected nested-name-specifier before 'namespase'
    4 | using namespase std;
      |       ^~~~~~~~~
a.cc:7:9: error: 'string' was not declared in this scope
    7 | int lcs(string X, string Y){
      |         ^~~~~~
a.cc:7:9: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from a.cc:2:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:7:19: error: 'string' was not declared in this scope
    7 | int lcs(string X, string Y){
      |                   ^~~~~~
a.cc:7:19: note: suggested alternatives:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:7:27: error: expression list treated as compound expression in initializer [-fpermissive]
    7 | int lcs(string X, string Y){
      |                           ^
a.cc: In function 'int main()':
a.cc:33:3: error: 'string' was not declared in this scope
   33 |   string s1, s2;
      |   ^~~~~~
a.cc:33:3: note: suggested alternatives:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:34:10: error: 'cin' was not declared in this scope
   34 |   int n; cin >> n;
      |          ^~~
a.cc:36:12: error: 's1' was not declared in this scope
   36 |     cin >> s1 >> s2;
      |            ^~
a.cc:36:18: error: 's2' was not declared in this scope
   36 |     cin >> s1 >> s2;
      |                  ^~
a.cc:37:5: error: 'cout' was not declared in this scope
   37 |     cout << lcs(s1, s2) << endl;
      |     ^~~~
a.cc:37:16: error: 'lcs' cannot be used as a function
   37 |     cout << lcs(s1, s2) << endl;
      |             ~~~^~~~~~~~
a.cc:37:28: error: 'endl' was not declared in this scope
   37 |     cout << lcs(s1, s2) << endl;
      |                            ^~~~