criyle/codenet-compile-errors huggingface dataset:
Language: C

#include <stdio.h>
#include <string.h>

#define MAX 1000

void LCSLength(char *X, char *Y){

    int i,j;
    int m = strlen(X);
    int n = strlen(Y);
    int c[m+1][n+1];

    for( i = 0 ; i <= m ; i++ ){
        for( j = 0 ; j <= n ;j++ ){
            c[i][j] = 0;
        }
    }

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

    printf("%d\n",c[m][n]);

    }

}



int main(){

    int n;
    int i;
    char line1[MAX],line2[MAX];

    scanf("%d",&n);

    for( i = 0 ; i < n ; i++ ){
        scanf("%s",line1);
        scanf("%s",line2);
        LCSLength(line1,line2);
    }

    

    return 0;
}

Compiler output:
main.c:36:1: error: expected identifier or '(' before '}' token
   36 | }
      | ^
Language: C

#include<stdio.h>
#include<string.h>
#include<math.h>

static const int N = 1000;

int lcs(char X[], char Y[], int m ,int n) {
  int c[N + 1][N +1];
  int maxl = 0,i,j;

  strcmp(&X[0], ` `);
  strcmp(&Y[0], ` `);
  for(i=1;i<=m;i++) c[i][0]=0;
  for(j=1;j<=n;j++) c[0][j]=0;

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

return maxl;
}

int main() {
  char s1[1001];
  char s2[1001];
  int i,n;

  scanf("%d\n", &n);
  for (i=0;i<n;i++) {
    scanf("%s", s1);
    scanf("%s", s2);
    printf("%d\n", lcs(s1,s2,(int)strlen(s1),(int)strlen(s2)));
  }
  return 0;
}

Compiler output:
main.c: In function 'lcs':
main.c:11:17: error: stray '`' in program
   11 |   strcmp(&X[0], ` `);
      |                 ^
main.c:11:19: error: stray '`' in program
   11 |   strcmp(&X[0], ` `);
      |                   ^
main.c:11:20: error: expected expression before ')' token
   11 |   strcmp(&X[0], ` `);
      |                    ^
main.c:12:17: error: stray '`' in program
   12 |   strcmp(&Y[0], ` `);
      |                 ^
main.c:12:19: error: stray '`' in program
   12 |   strcmp(&Y[0], ` `);
      |                   ^
main.c:12:20: error: expected expression before ')' token
   12 |   strcmp(&Y[0], ` `);
      |                    ^
Language: C

#include<stdio.h>
#include<string.h>
#define N 10000
char x[N],y[N];
void LCS()
{
  int a,b,i,j,c[N][N];
  a = strlen(x);
  b = strlen(y);
  for(i=1; i<=a; i++) c[i][0] = 0;
  for(j=1; j<=b; j++) c[0][j] = 0;
  for(i=1; i<=a; i++) {
    for(j=1; j<=b; j++) {
      if(x[i-1] == y[j-1]) c[i][j] = c[i-1][j-1] + 1;
      else if(c[i-1][j] >= c[i][j-1]) c[i][j] = c[i-1][j];
      else c[i][j] = c[i][j-1];
    }
  }
  printf("%d\n",c[m][n]);
}
 
int main()
{
  int n,i;
  scanf("%d",&n);
  for(i=0; i<n; i++) {
    scanf("%s%s",x,y);
    LCS();
  }
  return 0;
}

Compiler output:
main.c: In function 'LCS':
main.c:19:19: error: 'm' undeclared (first use in this function)
   19 |   printf("%d\n",c[m][n]);
      |                   ^
main.c:19:19: note: each undeclared identifier is reported only once for each function it appears in
main.c:19:22: error: 'n' undeclared (first use in this function)
   19 |   printf("%d\n",c[m][n]);
      |                      ^
Language: C

#include<iostream>
#include<string>
#include<algorithm>
using namespace 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=0;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:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>
#include <string.h>
??#define MAX 1000
??char X[MAX], Y[MAX];
??
int LCS() {
????????int i, j;
????????int m = strlen(X);
????????int n = strlen(Y);
????????int c[m + 1][n + 1];
??
????????for (i = 1; i <= m; i++) c[i][0] = 0;
????????for (j = 0; j <= n; j++) c[0][j] = 0;
??
????????for (i = 1; i <= m; i++) {
????????????????for (j = 1; j <= n; j++) {
????????????????????????if (X[i - 1] == Y[j - 1]) {
????????????????????????????????c[i][j] = c[i - 1][j - 1] + 1;
????????????????????????} else if (c[i - 1][j] >= c[i][j - 1]) {
????????????????????????????????c[i][j] = c[i - 1][j];
????????????????????????} else {
????????????????????????????????c[i][j] = c[i][j - 1];
????????????????????????}
????????????????}
????????}
??
????????return c[m][n];
}
??
int main() {
????????int n, i;
??
????????scanf("%d", &n);
????????for (i = 0; i < n; i++) {
????????????????scanf("%s%s", X, Y);
????????????????printf("%d\n", LCS());
????????}
??
????????return 0;
}

Compiler output:
main.c:3:1: error: expected identifier or '(' before '?' token
    3 | ??#define MAX 1000
      | ^
main.c:3:3: error: stray '#' in program
    3 | ??#define MAX 1000
      |   ^
main.c:5:1: error: expected identifier or '(' before '?' token
    5 | ??
      | ^
main.c:29:1: error: expected identifier or '(' before '?' token
   29 | ??
      | ^
Language: C

#include <stdio.h>
#include <string.h>
??#define MAX 1000
??char X[MAX], Y[MAX];
??
int LCS() {
????????int i, j;
????????int m = strlen(X);
????????int n = strlen(Y);
????????int c[m + 1][n + 1];
??
????????for (i = 1; i <= m; i++) c[i][0] = 0;
????????for (j = 0; j <= n; j++) c[0][j] = 0;
??
????????for (i = 1; i <= m; i++) {
????????????????for (j = 1; j <= n; j++) {
????????????????????????if (X[i - 1] == Y[j - 1]) {
????????????????????????????????c[i][j] = c[i - 1][j - 1] + 1;
????????????????????????} else if (c[i - 1][j] >= c[i][j - 1]) {
????????????????????????????????c[i][j] = c[i - 1][j];
????????????????????????} else {
????????????????????????????????c[i][j] = c[i][j - 1];
????????????????????????}
????????????????}
????????}
??
????????return c[m][n];
}
??
main() {
????????int n, i;
??
????????scanf("%d", &n);
????????for (i = 0; i < n; i++) {
????????????????scanf("%s%s", X, Y);
????????????????printf("%d\n", LCS());
????????}
??
????????return 0;
}

Compiler output:
main.c:3:1: error: expected identifier or '(' before '?' token
    3 | ??#define MAX 1000
      | ^
main.c:3:3: error: stray '#' in program
    3 | ??#define MAX 1000
      |   ^
main.c:5:1: error: expected identifier or '(' before '?' token
    5 | ??
      | ^
main.c:29:1: error: expected identifier or '(' before '?' token
   29 | ??
      | ^
Language: C

#include <stdio.h>
#include <string.h>
int lcs(char ,char);

 int main(){
 char x[1000],y[1000];
 int n,i,j;
 scanf("%d",&n);
 for(i = 0;i < n;i++){
    scanf("%s %s",x, y);
   printf("%d\n",lcs(x,y));
 }
 return 0;     
}

int lcs(char x[], char y[]){
 int i,j;
 int m = strlen(x);
 int n = strlen(y);
 int c[m+1][n+1];
 for(i = 0;i <= m; i++)
  c[i][0] = 0;
 for(j = 0;j <= n; j++)
  c[0][j] = 0;
 
 for(i = 1;i <= m; i++){
  for(j = 1;j <= n; j++){
    if(x[i-1] == y[j-1])
     c[i][j] = c[i-1][j-1] + 1;
    else if(c[i-1][j] >= c[i][j-1])
     c[i][j] = c[i-1][j];
    else
     c[i][j] = c[i][j-1];
  }
 }
 return c[m][n];
}

Compiler output:
main.c: In function 'main':
main.c:11:22: error: passing argument 1 of 'lcs' makes integer from pointer without a cast [-Wint-conversion]
   11 |    printf("%d\n",lcs(x,y));
      |                      ^
      |                      |
      |                      char *
main.c:3:9: note: expected 'char' but argument is of type 'char *'
    3 | int lcs(char ,char);
      |         ^~~~
main.c:11:24: error: passing argument 2 of 'lcs' makes integer from pointer without a cast [-Wint-conversion]
   11 |    printf("%d\n",lcs(x,y));
      |                        ^
      |                        |
      |                        char *
main.c:3:15: note: expected 'char' but argument is of type 'char *'
    3 | int lcs(char ,char);
      |               ^~~~
main.c: At top level:
main.c:16:5: error: conflicting types for 'lcs'; have 'int(char *, char *)'
   16 | int lcs(char x[], char y[]){
      |     ^~~
main.c:3:5: note: previous declaration of 'lcs' with type 'int(char,  char)'
    3 | int lcs(char ,char);
      |     ^~~
Language: C

#include<stdio.h>
#include<string.h>

#define N 1000

char A[N+1],B[N+1];
??
int lcn(){
????int i,j,m,n,max=0;
????int c[N+1][N+1];

????m=strlen(A);
????n=strlen(B);

????for(i=1;i<=m;i++) c[i][0]=0;
????for(j=1;j<=n;j++) c[0][j]=0;
??
????for(i=1;i<=m;i++){
????????for(j=1;j<=n;j++){
????????????if(A[i-1]==B[j-1]) c[i][j]=c[i-1][j-1] + 1;
????????????else if(c[i-1][j]>=c[i][j-1]) c[i][j]=c[i-1][j];
????????????else c[i][j]=c[i][j-1];
????????????max=Max(max,c[i][j]);
????????}
????}
????return max;
}
??
int Max(int a,int b){
????if(a>=b) return a;
????else return b;
}

int main(){
????int i,j,n;
????scanf("%d",&n);

????for(i=0;i<n;i++){
????????scanf("%s",A);
????????scanf("%s",B);
????????printf("%d\n",lcn());
????}
??
????return 0;
}

Compiler output:
main.c:7:1: error: expected identifier or '(' before '?' token
    7 | ??
      | ^
main.c:28:1: error: expected identifier or '(' before '?' token
   28 | ??
      | ^
main.c: In function 'main':
main.c:35:1: error: expected expression before '?' token
   35 | ????int i,j,n;
      | ^
main.c:36:1: error: expected expression before '?' token
   36 | ????scanf("%d",&n);
      | ^
main.c:36:17: error: 'n' undeclared (first use in this function)
   36 | ????scanf("%d",&n);
      |                 ^
main.c:36:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:38:1: error: expected expression before '?' token
   38 | ????for(i=0;i<n;i++){
      | ^
Language: C

#include <stdio.h>
#include <string.h>
#define N 1000
char s1[N+1],s2[N+1];

int lcs(void);
int max(int,int);
int main()
{
  int i,n;
  scanf("%d",&n);
  for(i=0;i<n;i++)
    {
      scanf("%s%s",s1,s2);
      printf("%d\n",lcs());
    }
  return 0;
}

int lcs()
{
  int i,j,m,n;
  m=strlen(s1);
  n=strlen(s2);
  for(i=1;i<=m;i++)
    {
      c[i][0]=0;
    }
  for(i=1;i<=n;i++)
    {
      c[0][i]=0;
    }
  for(i=1;i<=m;i++)
    {
      for(j=1;j<=n;j++)
        {
          if(t1[i-1]==t2[j-1])     c[i][j]=c[i-1][j-1]+1;
          else if(c[i-1][j]>=c[i][j-1]) c[i][j]=c[i-1][j];
          else  c[i][j]=c[i][j-1];

        }
    }
  return c[m][n];
}

Compiler output:
main.c: In function 'lcs':
main.c:27:7: error: 'c' undeclared (first use in this function)
   27 |       c[i][0]=0;
      |       ^
main.c:27:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:37:14: error: 't1' undeclared (first use in this function); did you mean 's1'?
   37 |           if(t1[i-1]==t2[j-1])     c[i][j]=c[i-1][j-1]+1;
      |              ^~
      |              s1
main.c:37:23: error: 't2' undeclared (first use in this function); did you mean 's2'?
   37 |           if(t1[i-1]==t2[j-1])     c[i][j]=c[i-1][j-1]+1;
      |                       ^~
      |                       s2
Language: C

#include <stdio.h>

static const int N = 1000;
char str1[N+1],str2[N+2]

int max(int x,int y){
  if(x>y) return x;
  else return y;
}

int longestCs(){
int c[N+1][N+1];
int max=0,i,j;

m=strlen(str1);
n=strlen(str2);

for(i=0;i<=m;i++) c[i][0]=0;
for(j=0;j<=n;j++) c[0][j]=0;

for(i=1;i<=m;i++){
  for(j=1;j<=n;j++){
    if(str1[i-1]==str2[j-1]){
      c[i][j]=c[i-1][j-1]+1;
    } else {
      c[i][j]=max(c[i-1][j],c[i][j-1]);
    }
    max=max(max,c[i][j]);
    }
  }

return max;
}

int main(){
int n,i;

scanf("%d",&n);
for(i=0;i<n;i++){
  scanf("%s",&str1);
  scanf("%s",&str2);
  printf("%d\n",longestCs());
  }
return 0;
}

Compiler output:
main.c:4:6: error: variably modified 'str1' at file scope
    4 | char str1[N+1],str2[N+2]
      |      ^~~~
main.c:6:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
    6 | int max(int x,int y){
      | ^~~
main.c: In function 'longestCs':
main.c:15:1: error: 'm' undeclared (first use in this function)
   15 | m=strlen(str1);
      | ^
main.c:15:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:15:3: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
   15 | m=strlen(str1);
      |   ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strlen'
    1 | #include <stdio.h>
  +++ |+#include <string.h>
    2 | 
main.c:15:3: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
   15 | m=strlen(str1);
      |   ^~~~~~
main.c:15:3: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:16:1: error: 'n' undeclared (first use in this function)
   16 | n=strlen(str2);
      | ^
main.c:16:10: error: 'str2' undeclared (first use in this function); did you mean 'str1'?
   16 | n=strlen(str2);
      |          ^~~~
      |          str1
main.c:26:15: error: called object 'max' is not a function or function pointer
   26 |       c[i][j]=max(c[i-1][j],c[i][j-1]);
      |               ^~~
main.c:13:5: note: declared here
   13 | int max=0,i,j;
      |     ^~~
main.c:28:9: error: called object 'max' is not a function or function pointer
   28 |     max=max(max,c[i][j]);
      |         ^~~
main.c:13:5: note: declared here
   13 | int max=0,i,j;
      |     ^~~
main.c: In function 'main':
main.c:41:15: error: 'str2' undeclared (first use in this function); did you mean 'str1'?
   41 |   scanf("%s",&str2);
      |               ^~~~
      |               str1
Language: C

#include <stdio.h>

static const int N = 1000;
char str1[N+1],str2[N+1];

int max(int x,int y){
  if(x>y) return x;
  else return y;
}

int longestCs(){
int c[N+1][N+1];
int maxv=0,i,j,m,n;

m=strlen(str1);
n=strlen(str2);

for(i=0;i<=m;i++) c[i][0]=0;
for(j=0;j<=n;j++) c[0][j]=0;

for(i=1;i<=m;i++){
  for(j=1;j<=n;j++){
    if(str1[i-1]==str2[j-1]){
      c[i][j]=c[i-1][j-1]+1;
    } else {
      c[i][j]=max(c[i-1][j],c[i][j-1]);
    }
    maxv=max(max,c[i][j]);
    }
  }

return maxv;
}

int main(){
int n,i;

scanf("%d",&n);
for(i=0;i<n;i++){
  scanf("%s",&str1);
  scanf("%s",&str2);
  printf("%d\n",longestCs());
  }
return 0;
}

Compiler output:
main.c:4:6: error: variably modified 'str1' at file scope
    4 | char str1[N+1],str2[N+1];
      |      ^~~~
main.c:4:16: error: variably modified 'str2' at file scope
    4 | char str1[N+1],str2[N+1];
      |                ^~~~
main.c: In function 'longestCs':
main.c:15:3: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
   15 | m=strlen(str1);
      |   ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strlen'
    1 | #include <stdio.h>
  +++ |+#include <string.h>
    2 | 
main.c:15:3: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
   15 | m=strlen(str1);
      |   ^~~~~~
main.c:15:3: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:28:14: error: passing argument 1 of 'max' makes integer from pointer without a cast [-Wint-conversion]
   28 |     maxv=max(max,c[i][j]);
      |              ^~~
      |              |
      |              int (*)(int,  int)
main.c:6:13: note: expected 'int' but argument is of type 'int (*)(int,  int)'
    6 | int max(int x,int y){
      |         ~~~~^
Language: C

#include <stdio.h>

static const int N = 1000;

int max(int x,int y){
  if(x>y) return x;
  else return y;
}

int longestCs(){
int c[N+1][N+1];
int maxv=0,i,j,m,n;

m=strlen(str1);
n=strlen(str2);

for(i=0;i<=m;i++) c[i][0]=0;
for(j=0;j<=n;j++) c[0][j]=0;

for(i=1;i<=m;i++){
  for(j=1;j<=n;j++){
    if(str1[i-1]==str2[j-1]){
      c[i][j]=c[i-1][j-1]+1;
    } else {
      c[i][j]=max(c[i-1][j],c[i][j-1]);
    }
    maxv=max(max,c[i][j]);
    }
  }

return maxv;
}

char str1[N+1],str2[N+1];

int main(){
int n,i;

scanf("%d",&n);
for(i=0;i<n;i++){
  scanf("%s",&str1);
  scanf("%s",&str2);
  printf("%d\n",longestCs());
  }
return 0;
}

Compiler output:
main.c: In function 'longestCs':
main.c:14:3: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
   14 | m=strlen(str1);
      |   ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strlen'
    1 | #include <stdio.h>
  +++ |+#include <string.h>
    2 | 
main.c:14:3: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
   14 | m=strlen(str1);
      |   ^~~~~~
main.c:14:3: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:14:10: error: 'str1' undeclared (first use in this function)
   14 | m=strlen(str1);
      |          ^~~~
main.c:14:10: note: each undeclared identifier is reported only once for each function it appears in
main.c:15:10: error: 'str2' undeclared (first use in this function)
   15 | n=strlen(str2);
      |          ^~~~
main.c:27:14: error: passing argument 1 of 'max' makes integer from pointer without a cast [-Wint-conversion]
   27 |     maxv=max(max,c[i][j]);
      |              ^~~
      |              |
      |              int (*)(int,  int)
main.c:5:13: note: expected 'int' but argument is of type 'int (*)(int,  int)'
    5 | int max(int x,int y){
      |         ~~~~^
main.c: At top level:
main.c:34:6: error: variably modified 'str1' at file scope
   34 | char str1[N+1],str2[N+1];
      |      ^~~~
main.c:34:16: error: variably modified 'str2' at file scope
   34 | char str1[N+1],str2[N+1];
      |                ^~~~
Language: C

#include <stdio.h>

static const int N = 1000;

int max(int x,int y){
  if(x>y) return x;
  else return y;
}

char str1[N+1],str2[N+1];

int longestCs(){
int c[N+1][N+1];
int maxv=0,i,j,m,n;

m=strlen(str1);
n=strlen(str2);

for(i=0;i<=m;i++) c[i][0]=0;
for(j=0;j<=n;j++) c[0][j]=0;

for(i=1;i<=m;i++){
  for(j=1;j<=n;j++){
    if(str1[i-1]==str2[j-1]){
      c[i][j]=c[i-1][j-1]+1;
    } else {
      c[i][j]=max(c[i-1][j],c[i][j-1]);
    }
    maxv=max(max,c[i][j]);
    }
  }

return maxv;
}

int main(){
int n,i;

scanf("%d",&n);
for(i=0;i<n;i++){
  scanf("%s",str1);
  scanf("%s",str2);
  printf("%d\n",longestCs());
  }
return 0;
}

Compiler output:
main.c:10:6: error: variably modified 'str1' at file scope
   10 | char str1[N+1],str2[N+1];
      |      ^~~~
main.c:10:16: error: variably modified 'str2' at file scope
   10 | char str1[N+1],str2[N+1];
      |                ^~~~
main.c: In function 'longestCs':
main.c:16:3: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
   16 | m=strlen(str1);
      |   ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strlen'
    1 | #include <stdio.h>
  +++ |+#include <string.h>
    2 | 
main.c:16:3: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
   16 | m=strlen(str1);
      |   ^~~~~~
main.c:16:3: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:29:14: error: passing argument 1 of 'max' makes integer from pointer without a cast [-Wint-conversion]
   29 |     maxv=max(max,c[i][j]);
      |              ^~~
      |              |
      |              int (*)(int,  int)
main.c:5:13: note: expected 'int' but argument is of type 'int (*)(int,  int)'
    5 | int max(int x,int y){
      |         ~~~~^
Language: C

#include <stdio.h>
#include <string.h>
 int main(){
 char x[1000],y[1000];
 int n,i,j;
 scanf("%d",&n);
 for(i = 0;i < n;i++){
    scanf("%s %s",x, y);
   printf("%d\n",cal(x,y));
 }
 return 0;
}

int cal(char x[], char y[]){

 int i,j;
 int m = strlen(x);
 int n = strlen(y);
 int count[m+1][n+1];

 for(i = 0;i <= m; i++){
  count[i][0] = 0;
  }
 for(j = 0;j <= n; j++){
  count[0][j] = 0;
  }
 for(i = 1;i <= m; i++){
  for(j = 1;j <= n; j++){
    if(x[i-1] == y[j-1])
     count[i][j] = count[i-1][j-1] + 1;
    else if(cou[i-1][j] >= cou[i][j-1]){
     count[i][j] = count[i-1][j];
  }
    else
     count[i][j] = count[i][j-1];
  }
 }
 return count[m][n];
}

Compiler output:
main.c: In function 'main':
main.c:9:18: error: implicit declaration of function 'cal' [-Wimplicit-function-declaration]
    9 |    printf("%d\n",cal(x,y));
      |                  ^~~
main.c: In function 'cal':
main.c:31:13: error: 'cou' undeclared (first use in this function); did you mean 'count'?
   31 |     else if(cou[i-1][j] >= cou[i][j-1]){
      |             ^~~
      |             count
main.c:31:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>


int LCS(int X,int Y,int a ,int b ){
	
int count,i,j;
for(i=0;i<a;i++){
for(j=0;j<i;j++){
if(X[i]==Y[j])
count++;
}
}
return count;
}

int main(){
	
	int q,X,Y
	int a=0,b=0;
	
	int n[1000],m[1000];
	
	scanf("%d",&q);
	for(i=0;i<=q;i++){
		
	for(i=0;i<1000;i++){
	scanf("%d",&n[i]);
	a++;
	if(n[i]==\n)
	break;}
	for(i=0;i<1000;i++){
	scanf("%d",&m[i]);
	b++;
	if(m[i]==\n)
	break;}
	
	LCS(n[i],m[i],a,b);
	printf("%d\n",LCS);
	}
}
	return 0;
}

Compiler output:
main.c: In function 'LCS':
main.c:9:5: error: subscripted value is neither array nor pointer nor vector
    9 | if(X[i]==Y[j])
      |     ^
main.c:9:11: error: subscripted value is neither array nor pointer nor vector
    9 | if(X[i]==Y[j])
      |           ^
main.c: In function 'main':
main.c:19:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
   19 |         int a=0,b=0;
      |         ^~~
main.c:24:13: error: 'i' undeclared (first use in this function)
   24 |         for(i=0;i<=q;i++){
      |             ^
main.c:24:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:28:9: error: 'a' undeclared (first use in this function)
   28 |         a++;
      |         ^
main.c:29:18: error: stray '\' in program
   29 |         if(n[i]==\n)
      |                  ^
main.c:33:9: error: 'b' undeclared (first use in this function)
   33 |         b++;
      |         ^
main.c:34:18: error: stray '\' in program
   34 |         if(m[i]==\n)
      |                  ^
main.c: At top level:
main.c:41:9: error: expected identifier or '(' before 'return'
   41 |         return 0;
      |         ^~~~~~
main.c:42:1: error: expected identifier or '(' before '}' token
   42 | }
      | ^
Language: C

#include<stdio.h>


int LCS(int X,int Y,int a ,int b ){
	
int count,i,j;
for(i=0;i<a;i++){
for(j=0;j<i;j++){
if(X[i]==Y[j])
count++;
}
}
return count;
}

int main(){
	
int q,X,Y
int a=0,b=0;
	
int n[1000],m[1000];
	
scanf("%d",&q);
for(i=0;i<=q;i++){
		
for(i=0;i<1000;i++){
scanf("%d",&n[i]);
a++;
if(n[i]==\n)
break;}
for(i=0;i<1000;i++){
scanf("%d",&m[i]);
b++;
if(m[i]==\n)
break;}
	
LCS(n[i],m[i],a,b);
printf("%d\n",LCS);
}
}
return 0;
}

Compiler output:
main.c: In function 'LCS':
main.c:9:5: error: subscripted value is neither array nor pointer nor vector
    9 | if(X[i]==Y[j])
      |     ^
main.c:9:11: error: subscripted value is neither array nor pointer nor vector
    9 | if(X[i]==Y[j])
      |           ^
main.c: In function 'main':
main.c:19:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
   19 | int a=0,b=0;
      | ^~~
main.c:24:5: error: 'i' undeclared (first use in this function)
   24 | for(i=0;i<=q;i++){
      |     ^
main.c:24:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:28:1: error: 'a' undeclared (first use in this function)
   28 | a++;
      | ^
main.c:29:10: error: stray '\' in program
   29 | if(n[i]==\n)
      |          ^
main.c:33:1: error: 'b' undeclared (first use in this function)
   33 | b++;
      | ^
main.c:34:10: error: stray '\' in program
   34 | if(m[i]==\n)
      |          ^
main.c: At top level:
main.c:41:1: error: expected identifier or '(' before 'return'
   41 | return 0;
      | ^~~~~~
main.c:42:1: error: expected identifier or '(' before '}' token
   42 | }
      | ^
Language: C

#include<stdio.h>


int LCS(int X,int Y,int a ,int b ){
	
int count,i,j,a,b,X,Y;
for(i=0;i<a;i++){
for(j=0;j<i;j++){
if(X[i]==Y[j])
count++;
}
}
return count;
}

int main(){
	
int q,X,Y
int a=0,b=0;
	
int n[1000],m[1000];
	
scanf("%d",&q);
for(i=0;i<=q;i++){
		
for(i=0;i<1000;i++){
scanf("%d",&n[i]);
a++;
if(n[i]==\n)
break;}
for(i=0;i<1000;i++){
scanf("%d",&m[i]);
b++;
if(m[i]==\n)
break;}
	
LCS(n[i],m[i],a,b);
printf("%d\n",LCS);
}
}
return 0;
}

Compiler output:
main.c: In function 'LCS':
main.c:6:15: error: 'a' redeclared as different kind of symbol
    6 | int count,i,j,a,b,X,Y;
      |               ^
main.c:4:25: note: previous definition of 'a' with type 'int'
    4 | int LCS(int X,int Y,int a ,int b ){
      |                     ~~~~^
main.c:6:17: error: 'b' redeclared as different kind of symbol
    6 | int count,i,j,a,b,X,Y;
      |                 ^
main.c:4:32: note: previous definition of 'b' with type 'int'
    4 | int LCS(int X,int Y,int a ,int b ){
      |                            ~~~~^
main.c:6:19: error: 'X' redeclared as different kind of symbol
    6 | int count,i,j,a,b,X,Y;
      |                   ^
main.c:4:13: note: previous definition of 'X' with type 'int'
    4 | int LCS(int X,int Y,int a ,int b ){
      |         ~~~~^
main.c:6:21: error: 'Y' redeclared as different kind of symbol
    6 | int count,i,j,a,b,X,Y;
      |                     ^
main.c:4:19: note: previous definition of 'Y' with type 'int'
    4 | int LCS(int X,int Y,int a ,int b ){
      |               ~~~~^
main.c:9:5: error: subscripted value is neither array nor pointer nor vector
    9 | if(X[i]==Y[j])
      |     ^
main.c:9:11: error: subscripted value is neither array nor pointer nor vector
    9 | if(X[i]==Y[j])
      |           ^
main.c: In function 'main':
main.c:19:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
   19 | int a=0,b=0;
      | ^~~
main.c:24:5: error: 'i' undeclared (first use in this function)
   24 | for(i=0;i<=q;i++){
      |     ^
main.c:24:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:28:1: error: 'a' undeclared (first use in this function)
   28 | a++;
      | ^
main.c:29:10: error: stray '\' in program
   29 | if(n[i]==\n)
      |          ^
main.c:33:1: error: 'b' undeclared (first use in this function)
   33 | b++;
      | ^
main.c:34:10: error: stray '\' in program
   34 | if(m[i]==\n)
      |          ^
main.c: At top level:
main.c:41:1: error: expected identifier or '(' before 'return'
   41 | return 0;
      | ^~~~~~
main.c:42:1: error: expected identifier or '(' before '}' token
   42 | }
      | ^
Language: C

#include<stdio.h>


int void LCS(int X,int Y,int a ,int b ){
	
int count,i,j;
for(i=0;i<a;i++){
for(j=0;j<i;j++){
if(X[i]==Y[j])
count++;
}
}
return count;
}

int main(){
	
int q,X,Y
int a=0,b=0;
	
int n[1000],m[1000];
	
scanf("%d",&q);
for(i=0;i<=q;i++){
		
for(i=0;i<1000;i++){
scanf("%d",&n[i]);
a++;
if(n[i]==\n)
break;}
for(i=0;i<1000;i++){
scanf("%d",&m[i]);
b++;
if(m[i]==\n)
break;}
	
LCS(n[i],m[i],a,b);
printf("%d\n",LCS);
}
}
return 0;
}

Compiler output:
main.c:4:5: error: two or more data types in declaration specifiers
    4 | int void LCS(int X,int Y,int a ,int b ){
      |     ^~~~
main.c: In function 'LCS':
main.c:9:5: error: subscripted value is neither array nor pointer nor vector
    9 | if(X[i]==Y[j])
      |     ^
main.c:9:11: error: subscripted value is neither array nor pointer nor vector
    9 | if(X[i]==Y[j])
      |           ^
main.c: In function 'main':
main.c:19:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
   19 | int a=0,b=0;
      | ^~~
main.c:24:5: error: 'i' undeclared (first use in this function)
   24 | for(i=0;i<=q;i++){
      |     ^
main.c:24:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:28:1: error: 'a' undeclared (first use in this function)
   28 | a++;
      | ^
main.c:29:10: error: stray '\' in program
   29 | if(n[i]==\n)
      |          ^
main.c:33:1: error: 'b' undeclared (first use in this function)
   33 | b++;
      | ^
main.c:34:10: error: stray '\' in program
   34 | if(m[i]==\n)
      |          ^
main.c: At top level:
main.c:41:1: error: expected identifier or '(' before 'return'
   41 | return 0;
      | ^~~~~~
main.c:42:1: error: expected identifier or '(' before '}' token
   42 | }
      | ^
Language: C

#include <stdio.h>
#define N 1000

int lcs(string X,string Y)
  int m,n,i,j,c[N+1][N+1];
  m=X.length;
  n=Y.length;
  for(i=0;i<n;i++){
    c[i][0]=0;
  }
  for(j=0;j<n;j++){
    c[0][j]=0;
  }
  for(i=1;i<m;i++){
    for(j=0;j<n;j++){
      if(X[i]==Y[j]){
        c[i][j]=c[i-1][j-1]+1;
      }
      else if(c[i-1][j]>=c[i][j-1]){
        c[i][j]=c[i-1][j];
      }
      else {
        c[i][j]=c[i][j-1];
    }
  }
}

int main(void)
{
  string x,y;
  int i,n;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&x);
    scanf("%d",&y);
  }
  printf("%d\n",lcs(x,y));

  return 0;
}

Compiler output:
main.c:4:9: error: unknown type name 'string'; did you mean 'stdin'?
    4 | int lcs(string X,string Y)
      |         ^~~~~~
      |         stdin
main.c:4:18: error: unknown type name 'string'; did you mean 'stdin'?
    4 | int lcs(string X,string Y)
      |                  ^~~~~~
      |                  stdin
main.c:6:3: warning: data definition has no type or storage class
    6 |   m=X.length;
      |   ^
main.c:6:3: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int]
main.c:6:5: error: 'X' undeclared here (not in a function)
    6 |   m=X.length;
      |     ^
main.c:7:3: warning: data definition has no type or storage class
    7 |   n=Y.length;
      |   ^
main.c:7:3: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:7:5: error: 'Y' undeclared here (not in a function)
    7 |   n=Y.length;
      |     ^
main.c:8:3: error: expected identifier or '(' before 'for'
    8 |   for(i=0;i<n;i++){
      |   ^~~
main.c:8:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    8 |   for(i=0;i<n;i++){
      |            ^
main.c:8:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    8 |   for(i=0;i<n;i++){
      |                ^~
main.c:11:3: error: expected identifier or '(' before 'for'
   11 |   for(j=0;j<n;j++){
      |   ^~~
main.c:11:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   11 |   for(j=0;j<n;j++){
      |            ^
main.c:11:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   11 |   for(j=0;j<n;j++){
      |                ^~
main.c:14:3: error: expected identifier or '(' before 'for'
   14 |   for(i=1;i<m;i++){
      |   ^~~
main.c:14:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   14 |   for(i=1;i<m;i++){
      |            ^
main.c:14:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   14 |   for(i=1;i<m;i++){
      |                ^~
main.c: In function 'main':
main.c:30:3: error: unknown type name 'string'; did you mean 'stdin'?
   30 |   string x,y;
      |   ^~~~~~
      |   stdin
main.c:37:17: error: implicit declaration of function 'lcs' [-Wimplicit-function-declaration]
   37 |   printf("%d\n",lcs(x,y));
      |                 ^~~
Language: C

#include <stdio.h>
#define N 1000

String lcs(string X,string Y)
  int m,n,i,j,c[N+1][N+1];
  m=X.length;
  n=Y.length;
  for(i=0;i<n;i++){
    c[i][0]=0;
  }
  for(j=0;j<n;j++){
    c[0][j]=0;
  }
  for(i=1;i<m;i++){
    for(j=0;j<n;j++){
      if(X[i]==Y[j]){
        c[i][j]=c[i-1][j-1]+1;
      }
      else if(c[i-1][j]>=c[i][j-1]){
        c[i][j]=c[i-1][j];
      }
      else {
        c[i][j]=c[i][j-1];
    }
  }
}

int main(void)
{
  string x,y;
  int i,n;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&x);
    scanf("%d",&y);
  }
  printf("%d\n",lcs(x,y));

  return 0;
}

Compiler output:
main.c:4:1: error: unknown type name 'String'
    4 | String lcs(string X,string Y)
      | ^~~~~~
main.c:4:12: error: unknown type name 'string'; did you mean 'stdin'?
    4 | String lcs(string X,string Y)
      |            ^~~~~~
      |            stdin
main.c:4:21: error: unknown type name 'string'; did you mean 'stdin'?
    4 | String lcs(string X,string Y)
      |                     ^~~~~~
      |                     stdin
main.c:6:3: warning: data definition has no type or storage class
    6 |   m=X.length;
      |   ^
main.c:6:3: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int]
main.c:6:5: error: 'X' undeclared here (not in a function)
    6 |   m=X.length;
      |     ^
main.c:7:3: warning: data definition has no type or storage class
    7 |   n=Y.length;
      |   ^
main.c:7:3: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:7:5: error: 'Y' undeclared here (not in a function)
    7 |   n=Y.length;
      |     ^
main.c:8:3: error: expected identifier or '(' before 'for'
    8 |   for(i=0;i<n;i++){
      |   ^~~
main.c:8:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    8 |   for(i=0;i<n;i++){
      |            ^
main.c:8:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    8 |   for(i=0;i<n;i++){
      |                ^~
main.c:11:3: error: expected identifier or '(' before 'for'
   11 |   for(j=0;j<n;j++){
      |   ^~~
main.c:11:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   11 |   for(j=0;j<n;j++){
      |            ^
main.c:11:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   11 |   for(j=0;j<n;j++){
      |                ^~
main.c:14:3: error: expected identifier or '(' before 'for'
   14 |   for(i=1;i<m;i++){
      |   ^~~
main.c:14:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   14 |   for(i=1;i<m;i++){
      |            ^
main.c:14:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   14 |   for(i=1;i<m;i++){
      |                ^~
main.c: In function 'main':
main.c:30:3: error: unknown type name 'string'; did you mean 'stdin'?
   30 |   string x,y;
      |   ^~~~~~
      |   stdin
main.c:37:17: error: implicit declaration of function 'lcs' [-Wimplicit-function-declaration]
   37 |   printf("%d\n",lcs(x,y));
      |                 ^~~
Language: C

#include<stdio.h>

int main() {
   int q, a, i, u[150];
   char X[1000], Y[1000];
   a = 0;
   scanf("%d", &q);
     
   for ( i = 0; i < q; i++ ) {
      scanf("%s", X);
      scanf("%s", Y);
      u[i] = Dynamic(X, Y);
   }
     
   for ( i = 0; i < q; i++ ) {
      printf("%d\n", u[i]);
   }

   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:14: error: implicit declaration of function 'Dynamic' [-Wimplicit-function-declaration]
   12 |       u[i] = Dynamic(X, Y);
      |              ^~~~~~~
Language: C

#include<stdio.h>
 
int main() {
   int q, a, i, u[150];
   char X[1000], Y[1000];
   a = 0;
   scanf("%d", &q);
      
   for ( i = 0; i < q; i++ ) {
      scanf("%s", X);
      scanf("%s", Y);
      u[i] = Dynamic(X, Y);
   }
      
   for ( i = 0; i < q; i++ ) {
      printf("%s\n", u[i]);
   }
 
   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:14: error: implicit declaration of function 'Dynamic' [-Wimplicit-function-declaration]
   12 |       u[i] = Dynamic(X, Y);
      |              ^~~~~~~
Language: C

#include<stdio.h>
 
int main() {
   int q, a, i, u[150];
   char X[1000], Y[1000];
   a = 0;
   scanf("%d", &q);
      
   for ( i = 0; i < q; i++ ) {
      scanf("%s", X);
      scanf("%s", Y);
      u[i] = dynamic(X, Y);
   }
      
   for ( i = 0; i < q; i++ ) {
      printf("%d\n", u[i]);
   }
 
   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:14: error: implicit declaration of function 'dynamic' [-Wimplicit-function-declaration]
   12 |       u[i] = dynamic(X, Y);
      |              ^~~~~~~
Language: C

#include <stdio.h>
#include <string.h>

void Ics(char *X, char *Y)
{
   int c[1000][1000];
   int m, n, i, j;

   m = strlen(X);
   n = strlen(Y);

   for ( i = 0; i <= m, i++ ) {
      c[i][0] = 0;
   }
   for ( j = 1; j <= n; j++ ) {
      c[0][j] =0;
   }

   for ( i = 1; i <= m; i++ ) {
      for ( j = 1; j <=n; j++ ) {
         if ( X[ i - 1 ] == Y[ j - 1] ) {
            c[ i ][ j ] = c[ i - 1 ][ j - 1 ] + 1;
         } else if ( c[ i - 1 ][ j ] >= c[ i ][ j - 1 ] ){
            c[ i ][ j ] = c[ i - 1 ][ j ];
         } else {
            c[ i ][ j ] = c[ i ][ j - 1 ];
         }
      }
   }
   printf("%d\n", c[ m ][ n ]);
}
     
int main()
{
   int q, i;
   char X[1000], Y[1000];

   scanf("%d", &q);
   for ( i = 0; i < q; i++ ) {
      scanf("%s%s", X, Y);
      Ics(X, Y);
   }
   return 0;
}

Compiler output:
main.c: In function 'Ics':
main.c:12:28: error: expected ';' before ')' token
   12 |    for ( i = 0; i <= m, i++ ) {
      |                            ^~
      |                            ;
Language: C

#include <stdio.h>
#include <string.h>

void Ics(char *X, char *Y)
{
   int c[1000][1000];
   int m, n, i, j;

   m = strlen(X);
   n = strlen(Y);

   for ( i = 1; i <= m, i++ ) {
      c[i][0] = 0;
   }
   for ( j = 1; j <= n; j++ ) {
      c[0][j] =0;
   }

   for ( i = 1; i <= m; i++ ) {
      for ( j = 1; j <=n; j++ ) {
         if ( X[ i - 1 ] == Y[ j - 1] ) {
            c[ i ][ j ] = c[ i - 1 ][ j - 1 ] + 1;
         } else if ( c[ i - 1 ][ j ] >= c[ i ][ j - 1 ] ){
            c[ i ][ j ] = c[ i - 1 ][ j ];
         } else {
            c[ i ][ j ] = c[ i ][ j - 1 ];
         }
      }
   }
   printf("%d\n", c[ m ][ n ]);
}
     
int main()
{
   int q, i;
   char X[1000], Y[1000];

   scanf("%d", &q);
   for ( i = 0; i < q; i++ ) {
      scanf("%s%s", X, Y);
      Ics(X, Y);
   }
   return 0;
}

Compiler output:
main.c: In function 'Ics':
main.c:12:28: error: expected ';' before ')' token
   12 |    for ( i = 1; i <= m, i++ ) {
      |                            ^~
      |                            ;
Language: C

#include <stdio.h>
#include <string.h>

void Ics(char *X, char *Y)
{
   int c[1000][1000];
   int m, n, i, j;

   m = strlen(X);
   n = strlen(Y);

   for ( i = 1; i <= m, i++ ) {
      c[i][0] = 0;
   }
   for ( j = 0; j <= n; j++ ) {
      c[0][j] =0;
   }

   for ( i = 1; i <= m; i++ ) {
      for ( j = 1; j <=n; j++ ) {
         if ( X[ i - 1 ] == Y[ j - 1] ) {
            c[ i ][ j ] = c[ i - 1 ][ j - 1 ] + 1;
         } else if ( c[ i - 1 ][ j ] >= c[ i ][ j - 1 ] ){
            c[ i ][ j ] = c[ i - 1 ][ j ];
         } else {
            c[ i ][ j ] = c[ i ][ j - 1 ];
         }
      }
   }
   printf("%d\n", c[ m ][ n ]);
}
     
int main()
{
   int q, i;
   char X[1000], Y[1000];

   scanf("%d", &q);
   for ( i = 0; i < q; i++ ) {
      scanf("%s%s", X, Y);
      Ics(X, Y);
   }
   return 0;
}

Compiler output:
main.c: In function 'Ics':
main.c:12:28: error: expected ';' before ')' token
   12 |    for ( i = 1; i <= m, i++ ) {
      |                            ^~
      |                            ;
Language: C

#include <stdio.h>
#include <string.h>

void Ics(char *X, char *Y)
{
   int c[1000][1000];
   int m, n, i, j;

   m = strlen(X);
   n = strlen(Y);

   for ( i = 1; i <= m, i++ ) {
      c[i][0] = 0;
   }
   for ( j = 0; j <= n; j++ ) {
      c[0][j] =0;
   }

   for ( i = 1; i <= m; i++ ) {
      for ( j = 1; j <=n; j++ ) {
         if ( X[ i - 1 ] == Y[ j - 1] ) {
            c[ i ][ j ] = c[ i - 1 ][ j - 1 ] + 1;
         } else if ( c[ i - 1 ][ j ] >= c[ i ][ j - 1 ] ){
            c[ i ][ j ] = c[ i - 1 ][ j ];
         } else {
            c[ i ][ j ] = c[ i ][ j - 1 ];
         }
      }
   }
   printf("%d\n", c[ m ][ n ]);
}
     
int main()
{
   int n, i;
   char X[1000], Y[1000];

   scanf("%d", &n);
   for ( i = 0; i < n; i++ ) {
      scanf("%s%s", X, Y);
      Ics(X, Y);
   }
   return 0;
}

Compiler output:
main.c: In function 'Ics':
main.c:12:28: error: expected ';' before ')' token
   12 |    for ( i = 1; i <= m, i++ ) {
      |                            ^~
      |                            ;
Language: C

#include <stdio.h>
#include <string.h>

void Ics(char *X, char *Y)
{
   int c[1000][1000];
   int m, n, i, j;

   m = strlen(X);
   n = strlen(Y);

   for ( i = 0; i <= m, i++ ) {
      c[i][0] = 0;
   }
   for ( j = 0; j <= n; j++ ) {
      c[0][j] =0;
   }

   for ( i = 1; i <= m; i++ ) {
      for ( j = 1; j <=n; j++ ) {
         if ( X[ i - 1 ] == Y[ j - 1] ) {
            c[ i ][ j ] = c[ i - 1 ][ j - 1 ] + 1;
         } else if ( c[ i - 1 ][ j ] >= c[ i ][ j - 1 ] ){
            c[ i ][ j ] = c[ i - 1 ][ j ];
         } else {
            c[ i ][ j ] = c[ i ][ j - 1 ];
         }
      }
   }
   printf("%d\n", c[ m ][ n ]);
}
     
int main()
{
   int n, i;
   char X[1000], Y[1000];

   scanf("%d", &n);
   for ( i = 0; i < n; i++ ) {
      scanf("%s%s", X, Y);
      Ics(X, Y);
   }
   return 0;
}

Compiler output:
main.c: In function 'Ics':
main.c:12:28: error: expected ';' before ')' token
   12 |    for ( i = 0; i <= m, i++ ) {
      |                            ^~
      |                            ;
Language: C

#include <stdio.h>
#include <string.h>

void Ics(char *X, char *Y)
{
   int c[1000][1000];
   int m, n, i, j;

   m = strlen(X);
   n = strlen(Y);

   for ( i = 0; i <= m, i++ ) {
      c[i][0] = 0;
   }
   for ( j = 0; j <= n; j++ ) {
      c[0][j] =0;
   }

   for ( i = 0; i <= m; i++ ) {
      for ( j = 1; j <=n; j++ ) {
         if ( X[ i - 1 ] == Y[ j - 1] ) {
            c[ i ][ j ] = c[ i - 1 ][ j - 1 ] + 1;
         } else if ( c[ i - 1 ][ j ] >= c[ i ][ j - 1 ] ){
            c[ i ][ j ] = c[ i - 1 ][ j ];
         } else {
            c[ i ][ j ] = c[ i ][ j - 1 ];
         }
      }
   }
   printf("%d\n", c[ m ][ n ]);
}
     
int main()
{
   int n, i;
   char X[1000], Y[1000];

   scanf("%d", &n);
   for ( i = 0; i < n; i++ ) {
      scanf("%s%s", X, Y);
      Ics(X, Y);
   }
   return 0;
}

Compiler output:
main.c: In function 'Ics':
main.c:12:28: error: expected ';' before ')' token
   12 |    for ( i = 0; i <= m, i++ ) {
      |                            ^~
      |                            ;
Language: C

#include <stdio.h>
#include <string.h>
#define N 1000
#define n 150

void Ics(char *X, char *Y)
{
   int c[N][N];
   int m, n, i, j;

   m = strlen(X);
   n = strlen(Y);

   for ( i = 1; i <= m; i++ ) {
      c[i][0] = 0;
   }
   for ( j = 0; j <= n; j++ ) {
      c[0][j] =0;
   }

   for ( i = 1; i <= m; i++ ) {
      for ( j = 1; j <=n; j++ ) {
         if ( X[ i - 1 ] == Y[ j - 1] ) {
            c[ i ][ j ] = c[ i - 1 ][ j - 1 ] + 1;
         } else if ( c[ i - 1 ][ j ] >= c[ i ][ j - 1 ] ){
            c[ i ][ j ] = c[ i - 1 ][ j ];
         } else {
            c[ i ][ j ] = c[ i ][ j - 1 ];
         }
      }
   }
   printf("%d\n", c[ m ][ n ]);
}
     
int main()
{
   int n, i;
   char X[N], Y[N];

   scanf("%d", &n);
   for ( i = 0; i < n; i++ ) {
      scanf("%s%s", X, Y);
      Ics(X, Y);
   }
   return 0;
}

Compiler output:
main.c: In function 'Ics':
main.c:4:11: error: expected identifier or '(' before numeric constant
    4 | #define n 150
      |           ^~~
main.c:9:11: note: in expansion of macro 'n'
    9 |    int m, n, i, j;
      |           ^
main.c:12:6: error: lvalue required as left operand of assignment
   12 |    n = strlen(Y);
      |      ^
main.c:14:10: error: 'i' undeclared (first use in this function)
   14 |    for ( i = 1; i <= m; i++ ) {
      |          ^
main.c:14:10: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:10: error: 'j' undeclared (first use in this function)
   17 |    for ( j = 0; j <= n; j++ ) {
      |          ^
main.c: In function 'main':
main.c:4:11: error: expected identifier or '(' before numeric constant
    4 | #define n 150
      |           ^~~
main.c:37:8: note: in expansion of macro 'n'
   37 |    int n, i;
      |        ^
main.c:40:16: error: lvalue required as unary '&' operand
   40 |    scanf("%d", &n);
      |                ^
main.c:41:10: error: 'i' undeclared (first use in this function)
   41 |    for ( i = 0; i < n; i++ ) {
      |          ^
Language: C

#include<stdio.h>

int hantei(char x[], char y[]) {
????int xn = 0, yn = 0, flag = 0, i, j, max = 0;
????int c[1001][1001];

????while (flag == 0)
????{
????????if (x[xn] != '\0')
????????{
????????????xn++;
????????}
????????else
????????{
????????????flag = 1;
????????}
????}

????flag = 0;

????while (flag == 0)
????{
????????if (y[yn] != '\0')
????????{
????????????yn++;
????????}
????????else
????????{
????????????flag = 1;
????????}
????}
????for (i = 1; i < xn + 1; i++) c[i][0] = 0;
????for (j = 1; j < yn + 1; j++) c[0][j] = 0;

  for (i = 1; i < xn + 1; i++)
????{
????????for (j = 1; j < yn + 1; j++)
????????{
????????????if (x[i - 1] == y[j - 1])
????????????{
????????????????c[i][j] = c[i - 1][j - 1] + 1;
????????????}
????????????else if (c[i - 1][j] >= c[i][j - 1])
????????????{
????????????????c[i][j] = c[i - 1][j];
????????????}
????????????else
????????????{
????????????????c[i][j] = c[i][j - 1];
????????????}
????????????if (max < c[i][j]) max = c[i][j];
????????}
????}

????return max;
}

int main(void) {
????char x[1000], y[1000];
????int q, i;

????scanf("%d", &q);

????for (i = 0; i < q; i++)
????{
????????scanf("%s", x);
????????scanf("%s", y);
????????printf("%d\n", hantei(x, y));
????}

????return 0;
}

Compiler output:
main.c: In function 'hantei':
main.c:4:1: error: expected expression before '?' token
    4 | ????int xn = 0, yn = 0, flag = 0, i, j, max = 0;
      | ^
main.c:5:1: error: expected expression before '?' token
    5 | ????int c[1001][1001];
      | ^
main.c:7:1: error: expected expression before '?' token
    7 | ????while (flag == 0)
      | ^
main.c:21:1: error: expected expression before '?' token
   21 | ????while (flag == 0)
      | ^
main.c:33:1: error: expected expression before '?' token
   33 | ????for (j = 1; j < yn + 1; j++) c[0][j] = 0;
      | ^
main.c:35:8: error: 'i' undeclared (first use in this function)
   35 |   for (i = 1; i < xn + 1; i++)
      |        ^
main.c:35:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:35:19: error: 'xn' undeclared (first use in this function); did you mean 'x'?
   35 |   for (i = 1; i < xn + 1; i++)
      |                   ^~
      |                   x
main.c:36:1: error: expected expression before '?' token
   36 | ????{
      | ^
main.c: In function 'main':
main.c:59:1: error: expected expression before '?' token
   59 | ????char x[1000], y[1000];
      | ^
main.c:60:1: error: expected expression before '?' token
   60 | ????int q, i;
      | ^
main.c:62:1: error: expected expression before '?' token
   62 | ????scanf("%d", &q);
      | ^
main.c:62:18: error: 'q' undeclared (first use in this function)
   62 | ????scanf("%d", &q);
      |                  ^
main.c:64:1: error: expected expression before '?' token
   64 | ????for (i = 0; i < q; i++)
      | ^
Language: C

#include<stdio.h>
#include<string.h>

int i, j, m, n;

int lcs(string X, string Y){
  int c[1001][1001];

  int m = strlen(X);
  int n = strlen(Y);
  int maxl = 0;

  X = ' '+X;
  Y = ' '+Y;

  for(i=0; i<=m; i++){
    c[i][0] = 0;
  }
  for(j=1; j<=n; j++){
    c[0][j] = 0;
  }

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

  return maxl;
}

int main(){
  string s1, s2;

  scanf("%d", &n);

  for(i=0; i<n; i++){
    scanf("%d %d", &s1, &s2);
    printf("%d\n", lcs(s1,s2));
  }

  return 0;
}

Compiler output:
main.c:6:9: error: unknown type name 'string'; did you mean 'stdin'?
    6 | int lcs(string X, string Y){
      |         ^~~~~~
      |         stdin
main.c:6:19: error: unknown type name 'string'; did you mean 'stdin'?
    6 | int lcs(string X, string Y){
      |                   ^~~~~~
      |                   stdin
main.c: In function 'main':
main.c:42:3: error: unknown type name 'string'; did you mean 'stdin'?
   42 |   string s1, s2;
      |   ^~~~~~
      |   stdin
main.c:48:20: error: implicit declaration of function 'lcs' [-Wimplicit-function-declaration]
   48 |     printf("%d\n", lcs(s1,s2));
      |                    ^~~