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

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

void CSLength(char *,char *);

int c[1000][1000],a[1000];

int main() {
  int i,j=0,q;
  char s[1000],x[1000],y[1000];

  scanf("%d",&q);

  for(i=0;i<q;i++){

    scanf("%s",s);
    strcpy(&x[1],s);

    scanf("%s",s);
    strcpy(&y[1],s);

    CSLength(x,y);
    a[i]=c[strlen(x)-1][strlen(y)-1];
  }

  for(i=0;i<q;i++){
    printf("%d\n",a[i]);
  }

  return 0;
}

void CSLength(char *x,char *y){
  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]==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];
    }
  }


  // for(i=0;i<=m;i++){
  //  for(j=0;j<=n;j++){  
  //   printf("%d ",c[i][j]);
  // }
  // printf("\n");
 }
}
  

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

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

void CSLength(char *,char *);

int c[1000][1000],a[1000];

int main() {
  int i,j=0,q;
  char s[1000],x[1000],y[1000];

  scanf("%d",&q);

  for(i=0;i<q;i++){

    scanf("%s",s);
    strcpy(&x[1],s);

    scanf("%s",s);
    strcpy(&y[1],s);

    CSLength(x,y);
    printf("%d\n",=c[strlen(x)-1][strlen(y)-1]);
    // a[i]=c[strlen(x)-1][strlen(y)-1];
  }

  //for(i=0;i<q;i++){
  //  printf("%d\n",a[i]);
  // }

  return 0;
}

void CSLength(char *x,char *y){
  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]==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];
    }
  }
}

Compiler output:
main.c: In function 'main':
main.c:23:19: error: expected expression before '=' token
   23 |     printf("%d\n",=c[strlen(x)-1][strlen(y)-1]);
      |                   ^
Language: C

#include <stdio.h>
#include <string.h>
#define MAX 1000

int lcs(char *,char *);

int main(){
  int n,i;
  char A[MAX+1],B[MAX+1];
  
  scanf("%d",&n);

  for(i=0;i<n;i++){
    A[0]=' ';
    B[0]=' ';
    scanf("%s",&A[1]);
    scanf("%s",&B[1]);
    printf("%d\n",lcs(A,B));
  }
  return 0;
}

int lcs(char *A,char *B){
  int m,n,i,j;
  char C[MAX+1][MAX+1];

  int max=0;
  
  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]==B[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];
    }
  }
  if(C[m][n]>max) max= C[m][n];
  return max-1;
}

]

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

#include<stdio.h>
#include<string.h>
#define N 1001

int n;

int lcs(char x[],char y[]){
  int i,j,a[N][N];
  int m=strlen(x);
  int n=strlen(y);

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

int main(){
  int i,A[N];
  char x[N],y[N];

  scanf("%d",&n);

  for(i=0;i<n;i++){
    scanf("%s",&x);
    scanf("%s",&y);
    A[i]=lcs(x,y);
  }
  for(i=0;i<n;i++) printf("%d\n",A[i]);

  return 0;
}

Compiler output:
main.c: In function 'lcs':
main.c:21:10: error: 'c' undeclared (first use in this function)
   21 |   return c[m][n];
      |          ^
main.c:21:10: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<string.h>
#define max(a,b) (((a)>(b))?(a):(b))
 
struct Point{x,y};

int main(void){
    int i,j,k;
    int q,tmp;
    Point len;
    int dp[1001][1001]={0};
    char x[1001],y[1001];
    scanf("%d",&q);
    for(i=0;i<q;i++){
        scanf("%s",x);
        scanf("%s",y);
        xlen=strlen(x);
        ylen=strlen(y);
        for(j=1;j<len.x+1;j++){
            for(k=1;k<len.y+1;k++){
                if(x[j-1]==y[k-1]){
                    dp[j][k]=dp[j-1][k-1]+1;    
                }else{
                    dp[j][k]=max(dp[j-1][k],dp[j][k-1]);
                }
            }
        }
        printf("%d\n",dp[len.x][len.y]);
    }
    return 0;
}           

Compiler output:
main.c:5:14: error: expected specifier-qualifier-list before 'x'
    5 | struct Point{x,y};
      |              ^
main.c: In function 'main':
main.c:10:5: error: unknown type name 'Point'; use 'struct' keyword to refer to the type
   10 |     Point len;
      |     ^~~~~
      |     struct 
main.c:17:9: error: 'xlen' undeclared (first use in this function); did you mean 'len'?
   17 |         xlen=strlen(x);
      |         ^~~~
      |         len
main.c:17:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:18:9: error: 'ylen' undeclared (first use in this function); did you mean 'len'?
   18 |         ylen=strlen(y);
      |         ^~~~
      |         len
main.c:19:22: error: request for member 'x' in something not a structure or union
   19 |         for(j=1;j<len.x+1;j++){
      |                      ^
main.c:20:26: error: request for member 'y' in something not a structure or union
   20 |             for(k=1;k<len.y+1;k++){
      |                          ^
main.c:28:29: error: request for member 'x' in something not a structure or union
   28 |         printf("%d\n",dp[len.x][len.y]);
      |                             ^
main.c:28:36: error: request for member 'y' in something not a structure or union
   28 |         printf("%d\n",dp[len.x][len.y]);
      |                                    ^
Language: C

`
#include<stdio.h>
#include<string.h>
#define max(a,b) (((a)>(b))?(a):(b))
 
struct Node {
  int xl;
  int yl;
};
struct Node len;

int main(void){
    int i,j,k;
    int q,tmp;

    int dp[1001][1001]={0};
    char x[1001],y[1001];
    scanf("%d",&q);
    for(i=0;i<q;i++){
        scanf("%s",x);
        scanf("%s",y);
        len.xl=strlen(x);
        len.yl=strlen(y);
        for(j=1;j<len.xl+1;j++){
            for(k=1;k<len.yl+1;k++){
                if(x[j-1]==y[k-1]){
                    dp[j][k]=dp[j-1][k-1]+1;    
                }else{
                    dp[j][k]=max(dp[j-1][k],dp[j][k-1]);
                }
            }
        }
        printf("%d\n",dp[len.xl][len.yl]);
    }
    return 0;
}           

Compiler output:
main.c:1:1: error: stray '`' in program
    1 | `
      | ^
Language: C

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

int lcs(char x[], char y[]){
 int i,j;
 int m = strlen(x);
 int 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 = 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];
  }
 }
 return c[m][n];
}

int main(){
}

Compiler output:
main.c: In function 'lcs':
main.c:10:3: error: 'c' undeclared (first use in this function)
   10 |   c[i][0] = 0;
      |   ^
main.c:10:3: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

int lcs(char x[], char y[]){
 int i,j;
 int m = strlen(x);
 int 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 = 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];
  }
 }
 return c[m][n];
}

int main(){
 char x[1000],y[1000];
 scanf("%d",&n);
 for(i = 0;i < n;i++){
    scanf("%s",X);
    scanf("%s",Y);
 }
 len1 = strlen(x);
 len2 = strlen(y);

 printf("%d\n",lcs(len1,len2));

 return 0;

     

 
}

Compiler output:
main.c: In function 'lcs':
main.c:10:3: error: 'c' undeclared (first use in this function)
   10 |   c[i][0] = 0;
      |   ^
main.c:10:3: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:29:14: error: 'n' undeclared (first use in this function)
   29 |  scanf("%d",&n);
      |              ^
main.c:30:6: error: 'i' undeclared (first use in this function)
   30 |  for(i = 0;i < n;i++){
      |      ^
main.c:31:16: error: 'X' undeclared (first use in this function)
   31 |     scanf("%s",X);
      |                ^
main.c:32:16: error: 'Y' undeclared (first use in this function)
   32 |     scanf("%s",Y);
      |                ^
main.c:34:2: error: 'len1' undeclared (first use in this function)
   34 |  len1 = strlen(x);
      |  ^~~~
main.c:35:2: error: 'len2' undeclared (first use in this function)
   35 |  len2 = strlen(y);
      |  ^~~~
Language: C

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

int lcs(char x[], char y[]){
 int i,j;
 int m = strlen(x);
 int 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 = 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];
  }
 }
 return c[m][n];
}

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

 printf("%d\n",lcs(len1,len2));

 return 0;

     

 
}

Compiler output:
main.c: In function 'lcs':
main.c:10:3: error: 'c' undeclared (first use in this function)
   10 |   c[i][0] = 0;
      |   ^
main.c:10:3: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:35:2: error: 'len1' undeclared (first use in this function)
   35 |  len1 = strlen(x);
      |  ^~~~
main.c:36:2: error: 'len2' undeclared (first use in this function)
   36 |  len2 = strlen(y);
      |  ^~~~
Language: C

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

int lcs(char x[], char y[]){
 int i,j;
 int m = strlen(x);
 int 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 = 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];
  }
 }
 return c[m][n];
}

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

 printf("%d\n",lcs(len1,len2));

 return 0;

     

 
}

Compiler output:
main.c: In function 'lcs':
main.c:10:3: error: 'c' undeclared (first use in this function)
   10 |   c[i][0] = 0;
      |   ^
main.c:10:3: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:38:20: error: passing argument 1 of 'lcs' makes pointer from integer without a cast [-Wint-conversion]
   38 |  printf("%d\n",lcs(len1,len2));
      |                    ^~~~
      |                    |
      |                    int
main.c:4:14: note: expected 'char *' but argument is of type 'int'
    4 | int lcs(char x[], char y[]){
      |         ~~~~~^~~
main.c:38:25: error: passing argument 2 of 'lcs' makes pointer from integer without a cast [-Wint-conversion]
   38 |  printf("%d\n",lcs(len1,len2));
      |                         ^~~~
      |                         |
      |                         int
main.c:4:24: note: expected 'char *' but argument is of type 'int'
    4 | int lcs(char x[], char y[]){
      |                   ~~~~~^~~
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 = 1; j <= n; i++) 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>

int c[N][N];

int lcs(char x[], char y[]){
 int m, i, n, 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] == y[j]) c[i][j] = c[i][j] + 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:4:7: error: 'N' undeclared here (not in a function)
    4 | int c[N][N];
      |       ^
main.c: In function 'lcs':
main.c:25:1: error: expected declaration or statement at end of input
   25 | return c[m][n];
      | ^~~~~~
Language: C

#include <stdio.h>

int main()
{
	char X[100], Y[100];
	int a[101][10
	1] = {0};
	int c[150] = {0};
	int q, xlen, ylen, i, j, k;
	
	scanf("%d", &q);
	
	for (k = 0; k < q; k++) {
		scanf("%s", X);
		scanf("%s", Y);
		xlen = strlen(X);
		ylen = strlen(Y);
		
		//?????????????????´?????????
		for (i = 0; i < xlen; i++) {
			for (j = 0; j < ylen; j++) {
				//?????´
				if (X[i] == Y[j]) {
					a[i+1][j+1] = a[i][j] + 1;
				} else {
				//????????´
					if (a[i][j+1] < a[i+1][j]) {
						a[i+1][j+1] = a[i+1][j];
					} else {
						a[i+1][j+1] = a[i][j+1];
					}
				}
			}
		}
		
		//????????????????????????
		i = xlen;
		j = ylen;
		while (a[i][j] > 0) {
			while (a[i][j-1] == a[i][j])
				j--;
			while (a[i-1][j] == a[i][j])
				i--;
			i -= 1;
			j -= 1;
			c[k] += 1;
		}
		
		//?????????
		for (i = 0; i < xlen; i++)
			X[i] = '\0';
		for (j = 0; j < ylen; j++)
			Y[i] = '\0';
		for (i = 0; i <= xlen; i++) {
			for (j = 0; j <= ylen; j++) {
				a[i][j] = 0;
			}
		}
	}
	
	for (k = 0; k < q; k++)
		printf("%d\n", c[k]);
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:22: error: expected ']' before numeric constant
    6 |         int a[101][10
      |                      ^
      |                      ]
    7 |         1] = {0};
      |         ~             
main.c:16:24: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
   16 |                 xlen = strlen(X);
      |                        ^~~~~~
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:24: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
   16 |                 xlen = strlen(X);
      |                        ^~~~~~
main.c:16:24: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:24:41: error: 'a' undeclared (first use in this function)
   24 |                                         a[i+1][j+1] = a[i][j] + 1;
      |                                         ^
main.c:24:41: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main()
{
	char X[100], Y[100];
	int a[101][10];
	1] = {0};
	int c[150] = {0};
	int q, xlen, ylen, i, j, k;
	
	scanf("%d", &q);
	
	for (k = 0; k < q; k++) {
		scanf("%s", X);
		scanf("%s", Y);
		xlen = strlen(X);
		ylen = strlen(Y);
		
		//?????????????????´?????????
		for (i = 0; i < xlen; i++) {
			for (j = 0; j < ylen; j++) {
				//?????´
				if (X[i] == Y[j]) {
					a[i+1][j+1] = a[i][j] + 1;
				} else {
				//????????´
					if (a[i][j+1] < a[i+1][j]) {
						a[i+1][j+1] = a[i+1][j];
					} else {
						a[i+1][j+1] = a[i][j+1];
					}
				}
			}
		}
		
		//????????????????????????
		i = xlen;
		j = ylen;
		while (a[i][j] > 0) {
			while (a[i][j-1] == a[i][j])
				j--;
			while (a[i-1][j] == a[i][j])
				i--;
			i -= 1;
			j -= 1;
			c[k] += 1;
		}
		
		//?????????
		for (i = 0; i < xlen; i++)
			X[i] = '\0';
		for (j = 0; j < ylen; j++)
			Y[i] = '\0';
		for (i = 0; i <= xlen; i++) {
			for (j = 0; j <= ylen; j++) {
				a[i][j] = 0;
			}
		}
	}
	
	for (k = 0; k < q; k++)
		printf("%d\n", c[k]);
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:10: error: expected ';' before ']' token
    7 |         1] = {0};
      |          ^
      |          ;
main.c:7:10: error: expected statement before ']' token
main.c:7:12: error: expected expression before '=' token
    7 |         1] = {0};
      |            ^
main.c:16:24: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
   16 |                 xlen = strlen(X);
      |                        ^~~~~~
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:24: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
   16 |                 xlen = strlen(X);
      |                        ^~~~~~
main.c:16:24: note: include '<string.h>' or provide a declaration of 'strlen'
Language: C

#include <stdio.h>

int main() {	
	char X[150][1000];
	char Y[150][1000];
	int figureXY[1001][1001] = { 0 };
	int longX, longY;
	int dataSetN;
	int max;
	int i, j, k;
	longX = 0;	longY = 0;
	max = 0;

	scanf_s("%d", &dataSetN);
	for (i = 0; i < dataSetN; i++) {
		scanf_s("%s", X[i], 2000);
		scanf_s("%s", Y[i], 2000);
	}

	for (i = 0; X[i] != '\n'; i++) {
		longX++;
	}
	for (i = 0; Y[i] != '\n'; i++) {
		longY++;
	}
	for (i = 0; i <= longX; i++) {
		figureXY[i][0] = 0;
	}
	for (i = 0; i <= longY; i++) {
		figureXY[0][i] = 0;
	}

	for (i = 0; i < dataSetN; i++) {
		max = 0;
		for (j = 1; j <= longX; j++) {
			for (k = 1; k <= longY; k++) {
				if (X[i][j - 1] == Y[i][k - 1]) {
					figureXY[j][k] = figureXY[j - 1][k - 1] + 1;
				}
				else if (figureXY[j - 1][k] >= figureXY[j][k - 1]) {
					figureXY[j][k] = figureXY[j - 1][k];
				}
				else {
					figureXY[j][k] = figureXY[j][k - 1];
				}

				max = figureXY[j][k] > max ? figureXY[j][k] : max;
			}
		}

		printf_s("%d\n", max);
	}

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   14 |         scanf_s("%d", &dataSetN);
      |         ^~~~~~~
      |         scanf
main.c:20:26: warning: comparison between pointer and integer
   20 |         for (i = 0; X[i] != '\n'; i++) {
      |                          ^~
main.c:23:26: warning: comparison between pointer and integer
   23 |         for (i = 0; Y[i] != '\n'; i++) {
      |                          ^~
main.c:51:17: error: implicit declaration of function 'printf_s'; did you mean 'printf'? [-Wimplicit-function-declaration]
   51 |                 printf_s("%d\n", max);
      |                 ^~~~~~~~
      |                 printf
Language: C

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

int LCS(char x[], char y[]) {
 m = strlen(x);
 n = strlen(y);
int c;

for(i=0;i<m;i++) 
  c[i][0] = 0;
for(i=0;i<n;i++;)
  c[0][i] = 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,  x[], y[];
 
 scanf("%d", &n);
 for(i=0;i<n;i++){
   scanf("%s %s", x[i], y[i]);
   printf("%d", LCS(x[i], y[i]));
 }
return 0;

}

Compiler output:
main.c: In function 'LCS':
main.c:5:2: error: 'm' undeclared (first use in this function)
    5 |  m = strlen(x);
      |  ^
main.c:5:2: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:2: error: 'n' undeclared (first use in this function)
    6 |  n = strlen(y);
      |  ^
main.c:9:5: error: 'i' undeclared (first use in this function)
    9 | for(i=0;i<m;i++)
      |     ^
main.c:11:16: error: expected ')' before ';' token
   11 | for(i=0;i<n;i++;)
      |    ~           ^
      |                )
main.c:12:4: error: subscripted value is neither array nor pointer nor vector
   12 |   c[0][i] = 0;
      |    ^
main.c:14:7: error: 'j' undeclared (first use in this function)
   14 |   for(j=1;j<n;j++){
      |       ^
main.c:20:26: error: expected ';' before '}' token
   20 |       c[i][j] = c[i][j-1]
      |                          ^
      |                          ;
   21 |   }
      |   ~                       
main.c: In function 'main':
main.c:28:13: error: array size missing in 'x'
   28 |  int n, i,  x[], y[];
      |             ^
main.c:28:18: error: array size missing in 'y'
   28 |  int n, i,  x[], y[];
      |                  ^
main.c:33:22: error: passing argument 1 of 'LCS' makes pointer from integer without a cast [-Wint-conversion]
   33 |    printf("%d", LCS(x[i], y[i]));
      |                     ~^~~
      |                      |
      |                      int
main.c:4:14: note: expected 'char *' but argument is of type 'int'
    4 | int LCS(char x[], char y[]) {
      |         ~~~~~^~~
main.c:33:28: error: passing argument 2 of 'LCS' makes pointer from integer without a cast [-Wint-conversion]
   33 |    printf("%d", LCS(x[i], y[i]));
      |                           ~^~~
      |                            |
      |                            int
main.c:4:24: note: expected 'char *' but argument is of type 'int'
    4 | int LCS(char x[], char y[]) {
      |                   ~~~~~^~~
Language: C

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

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

 m = strlen(x);
 n = strlen(y);
int c;

for(i=0;i<m;i++) 
  c[i][0] = 0;
for(i=0;i<n;i++;)
  c[0][i] = 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,  x[], y[];
 
 scanf("%d", &n);
 for(i=0;i<n;i++){
   scanf("%s %s", x[i], y[i]);
   printf("%d", LCS(x[i], y[i]));
 }
return 0;

}

Compiler output:
main.c: In function 'LCS':
main.c:6:2: error: 'm' undeclared (first use in this function)
    6 |  m = strlen(x);
      |  ^
main.c:6:2: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:2: error: 'n' undeclared (first use in this function)
    7 |  n = strlen(y);
      |  ^
main.c:10:5: error: 'i' undeclared (first use in this function)
   10 | for(i=0;i<m;i++)
      |     ^
main.c:12:16: error: expected ')' before ';' token
   12 | for(i=0;i<n;i++;)
      |    ~           ^
      |                )
main.c:13:4: error: subscripted value is neither array nor pointer nor vector
   13 |   c[0][i] = 0;
      |    ^
main.c:15:7: error: 'j' undeclared (first use in this function)
   15 |   for(j=1;j<n;j++){
      |       ^
main.c:21:26: error: expected ';' before '}' token
   21 |       c[i][j] = c[i][j-1]
      |                          ^
      |                          ;
   22 |   }
      |   ~                       
main.c: In function 'main':
main.c:29:13: error: array size missing in 'x'
   29 |  int n, i,  x[], y[];
      |             ^
main.c:29:18: error: array size missing in 'y'
   29 |  int n, i,  x[], y[];
      |                  ^
main.c:34:22: error: passing argument 1 of 'LCS' makes pointer from integer without a cast [-Wint-conversion]
   34 |    printf("%d", LCS(x[i], y[i]));
      |                     ~^~~
      |                      |
      |                      int
main.c:4:14: note: expected 'char *' but argument is of type 'int'
    4 | int LCS(char x[], char y[]) {
      |         ~~~~~^~~
main.c:34:28: error: passing argument 2 of 'LCS' makes pointer from integer without a cast [-Wint-conversion]
   34 |    printf("%d", LCS(x[i], y[i]));
      |                           ~^~~
      |                            |
      |                            int
main.c:4:24: note: expected 'char *' but argument is of type 'int'
    4 | int LCS(char x[], char y[]) {
      |                   ~~~~~^~~
Language: C

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

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

int m = strlen(x);
int n = strlen(y);
int c[][];

for(i=0;i<m;i++) 
  c[i][0] = 0;
for(i=0;i<n;i++;)
  c[0][i] = 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,  x[1000], y[1000];
 
 scanf("%d", &n);
 for(i=0;i<n;i++){
   scanf("%s %s", x, y);
   printf("%d", LCS(x, y));
 }
return 0;

}

Compiler output:
main.c: In function 'LCS':
main.c:8:5: error: array type has incomplete element type 'int[]'
    8 | int c[][];
      |     ^
main.c:8:5: note: declaration of 'c' as multidimensional array must have bounds for all dimensions except the first
main.c:10:5: error: 'i' undeclared (first use in this function)
   10 | for(i=0;i<m;i++)
      |     ^
main.c:10:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:16: error: expected ')' before ';' token
   12 | for(i=0;i<n;i++;)
      |    ~           ^
      |                )
main.c:15:7: error: 'j' undeclared (first use in this function)
   15 |   for(j=1;j<n;j++){
      |       ^
main.c:21:26: error: expected ';' before '}' token
   21 |       c[i][j] = c[i][j-1]
      |                          ^
      |                          ;
   22 |   }
      |   ~                       
main.c: In function 'main':
main.c:34:21: error: passing argument 1 of 'LCS' from incompatible pointer type [-Wincompatible-pointer-types]
   34 |    printf("%d", LCS(x, y));
      |                     ^
      |                     |
      |                     int *
main.c:4:14: note: expected 'char *' but argument is of type 'int *'
    4 | int LCS(char x[], char y[]) {
      |         ~~~~~^~~
main.c:34:24: error: passing argument 2 of 'LCS' from incompatible pointer type [-Wincompatible-pointer-types]
   34 |    printf("%d", LCS(x, y));
      |                        ^
      |                        |
      |                        int *
main.c:4:24: note: expected 'char *' but argument is of type 'int *'
    4 | int LCS(char x[], char y[]) {
      |                   ~~~~~^~~
Language: C

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

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

int m = strlen(x);
int n = strlen(y);
int c[1000][1000];

for(i=0;i<m;i++) 
  c[i][0] = 0;
for(i=0;i<n;i++;)
  c[0][i] = 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,  x[1000], y[1000];
 
 scanf("%d", &n);
 for(i=0;i<n;i++){
   scanf("%s %s", x, y);
   printf("%d", LCS(x, y));
 }
return 0;

}

Compiler output:
main.c: In function 'LCS':
main.c:10:5: error: 'i' undeclared (first use in this function)
   10 | for(i=0;i<m;i++)
      |     ^
main.c:10:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:16: error: expected ')' before ';' token
   12 | for(i=0;i<n;i++;)
      |    ~           ^
      |                )
main.c:15:7: error: 'j' undeclared (first use in this function)
   15 |   for(j=1;j<n;j++){
      |       ^
main.c:21:26: error: expected ';' before '}' token
   21 |       c[i][j] = c[i][j-1]
      |                          ^
      |                          ;
   22 |   }
      |   ~                       
main.c: In function 'main':
main.c:34:21: error: passing argument 1 of 'LCS' from incompatible pointer type [-Wincompatible-pointer-types]
   34 |    printf("%d", LCS(x, y));
      |                     ^
      |                     |
      |                     int *
main.c:4:14: note: expected 'char *' but argument is of type 'int *'
    4 | int LCS(char x[], char y[]) {
      |         ~~~~~^~~
main.c:34:24: error: passing argument 2 of 'LCS' from incompatible pointer type [-Wincompatible-pointer-types]
   34 |    printf("%d", LCS(x, y));
      |                        ^
      |                        |
      |                        int *
main.c:4:24: note: expected 'char *' but argument is of type 'int *'
    4 | int LCS(char x[], char y[]) {
      |                   ~~~~~^~~
Language: C

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

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

int m = strlen(x);
int n = strlen(y);
int c[1000][1000];
int i, j;
for(i=0;i<m;i++) 
  c[i][0] = 0;
for(i=0;i<n;i++;)
  c[0][i] = 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,  x[1000], y[1000];
 
 scanf("%d", &n);
 for(i=0;i<n;i++){
   scanf("%s %s", x, y);
   printf("%d", LCS(x, y));
 }
return 0;

}

Compiler output:
main.c: In function 'LCS':
main.c:12:16: error: expected ')' before ';' token
   12 | for(i=0;i<n;i++;)
      |    ~           ^
      |                )
main.c:21:26: error: expected ';' before '}' token
   21 |       c[i][j] = c[i][j-1]
      |                          ^
      |                          ;
   22 |   }
      |   ~                       
main.c: In function 'main':
main.c:34:21: error: passing argument 1 of 'LCS' from incompatible pointer type [-Wincompatible-pointer-types]
   34 |    printf("%d", LCS(x, y));
      |                     ^
      |                     |
      |                     int *
main.c:4:14: note: expected 'char *' but argument is of type 'int *'
    4 | int LCS(char x[], char y[]) {
      |         ~~~~~^~~
main.c:34:24: error: passing argument 2 of 'LCS' from incompatible pointer type [-Wincompatible-pointer-types]
   34 |    printf("%d", LCS(x, y));
      |                        ^
      |                        |
      |                        int *
main.c:4:24: note: expected 'char *' but argument is of type 'int *'
    4 | int LCS(char x[], char y[]) {
      |                   ~~~~~^~~
Language: C

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

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

int m = strlen(x);
int n = strlen(y);
int c[1000][1000];
int i, j;
for(i=0;i<m;i++) 
  c[i][0] = 0;
for(i=0;i<n;i++;)
  c[0][i] = 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,  x[1000], y[1000];
 
 scanf("%d", &n);
 for(i=0;i<n;i++){
   scanf("%s %s", x, y);
   printf("%d", LCS(x, y));
 }
return 0;

}

Compiler output:
main.c: In function 'LCS':
main.c:12:16: error: expected ')' before ';' token
   12 | for(i=0;i<n;i++;)
      |    ~           ^
      |                )
main.c: In function 'main':
main.c:34:21: error: passing argument 1 of 'LCS' from incompatible pointer type [-Wincompatible-pointer-types]
   34 |    printf("%d", LCS(x, y));
      |                     ^
      |                     |
      |                     int *
main.c:4:14: note: expected 'char *' but argument is of type 'int *'
    4 | int LCS(char x[], char y[]) {
      |         ~~~~~^~~
main.c:34:24: error: passing argument 2 of 'LCS' from incompatible pointer type [-Wincompatible-pointer-types]
   34 |    printf("%d", LCS(x, y));
      |                        ^
      |                        |
      |                        int *
main.c:4:24: note: expected 'char *' but argument is of type 'int *'
    4 | int LCS(char x[], char y[]) {
      |                   ~~~~~^~~
Language: C

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

int main(void)
{
  int q, i, j, k, m, n, c[1001][1001], i2, j2;
  char x[150][1001], y[150][1001];

  scanf("%d", &q);
  for (i = 0; i < q; i++) {
    scanf("%s", x[i]);
    scanf("%s", y[i]);
  }
  for (k = 0; k < q; k++) {
    m = strlen(x[k]);
    n = strlen(y[k]);
    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[k][i] == y[k][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]);
  }

Compiler output:
main.c: In function 'main':
main.c:39:3: error: expected declaration or statement at end of input
   39 |   }
      |   ^
Language: C

#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

static const int N = 100;

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; // X[0]?????????????????\
  Y = ' ' + Y; // Y[0]?????????????????\
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++) {
      if (X[i] == Y[i]) {
        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:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
#include<ctype.h>

int main(){
  
  int q, i;
  char  X[1001], Y[1001], Z[150];
  int C[1001][1001], maxl, xi, yi, i, j, ii;
  
  scanf("%d", &q);
  
  for( ii = 0; ii < q; ii++){
    scanf("%s", X);
    scanf("%s", Y);
    /*????????°*/
    xi = 0;
    while(X[xi]){
      xi++;
    }
    yi = 0;
    while(Y[yi]){
      yi++;
    }
    
    C[0][0] = 0;
    for(i = 1; i <= xi; i++) {
    C[i][0] = 0;
    X[xi - i + 1] = X[xi - i];
    }
    for(i = 1; i <= yi; i++) {
    C[0][i] = 0;
    Y[yi - i + 1] = Y[yi - i];
    }
    X[0] = ' ';
    Y[0] = ' ';

    /* c[][]*/
    maxl = 0;
    for( i = 1; i <= xi; i++){
      for( j = 1; j < yi; 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];
          }
        }
        
        if( maxl < C[i][j]){
          maxl = C[i][j];
        }
      }
    }
    
    Z[ii] = maxl;
  }
  
  for(ii = 0; ii < q; ii++){
    printf("%d\n",Z[ii]);
  }
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:36: error: redeclaration of 'i' with no linkage
    8 |   int C[1001][1001], maxl, xi, yi, i, j, ii;
      |                                    ^
main.c:6:10: note: previous declaration of 'i' with type 'int'
    6 |   int q, i;
      |          ^
Language: C

#include<stdio.h>
#include<ctype.h>

int main(){
  
  int q, i;
  char  X[1001], Y[1001];
  int C[1001][1001], Z[150], maxl, xi, yi, i, j, ii;
  
  scanf("%d", &q);
  
  for( ii = 0; ii < q; ii++){
    scanf("%s", X);
    scanf("%s", Y);
    /*????????°*/
    xi = 0;
    while(X[xi]){
      xi++;
    }
    yi = 0;
    while(Y[yi]){
      yi++;
    }
    
    C[0][0] = 0;
    for(i = 1; i <= xi; i++) {
    C[i][0] = 0;
    X[xi - i + 1] = X[xi - i];
    }
    for(i = 1; i <= yi; i++) {
    C[0][i] = 0;
    Y[yi - i + 1] = Y[yi - i];
    }
    X[0] = ' ';
    Y[0] = ' ';

    /* c[][]*/
    maxl = 0;
    for( i = 1; i <= xi; i++){
      for( j = 1; j < yi; 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];
          }
        }
        
        if( maxl < C[i][j]){
          maxl = C[i][j];
        }
      }
    }
    
    Z[ii] = maxl;
  }
  
  for(ii = 0; ii < q; ii++){
    printf("%d\n",Z[ii]);
  }
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:44: error: redeclaration of 'i' with no linkage
    8 |   int C[1001][1001], Z[150], maxl, xi, yi, i, j, ii;
      |                                            ^
main.c:6:10: note: previous declaration of 'i' with type 'int'
    6 |   int q, i;
      |          ^
Language: C

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

int lcs(char X, char Y) {
   int c[1000+1][1000+1];
   int m, n, max = 0;

   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] == 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[j-1][j];
         } else {
           c[i][j] = c[i][j-1];
         }
       if (max < c[i][j]) {
         max = c[i][j];
       }
     }
   }
   return max;
}

int main () {
   char s1, s2;
   int n;

   scanf("%d\n", &n);

   for (i = 0; i < n; i++) {
     scanf ("%s", s1);
     scanf ("%s", s2);

     printf("%d\n", lcs(s1, s2));
   }
   return 0;
}

Compiler output:
main.c: In function 'lcs':
main.c:8:15: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
    8 |    m = strlen(X);
      |               ^
      |               |
      |               char
In file included from main.c:2:
/usr/include/string.h:407:35: note: expected 'const char *' but argument is of type 'char'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
main.c:9:15: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
    9 |    n = strlen(Y);
      |               ^
      |               |
      |               char
/usr/include/string.h:407:35: note: expected 'const char *' but argument is of type 'char'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
main.c:11:9: error: 'i' undeclared (first use in this function)
   11 |    for (i = 1; i < m; i++) {
      |         ^
main.c:11:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:9: error: 'j' undeclared (first use in this function)
   14 |    for (j = 1; j < n; j++) {
      |         ^
main.c: In function 'main':
main.c:40:9: error: 'i' undeclared (first use in this function)
   40 |    for (i = 0; i < n; i++) {
      |         ^
Language: C

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

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

   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] == 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[j-1][j];
         } else {
           c[i][j] = c[i][j-1];
         }
       if (max < c[i][j]) {
         max = c[i][j];
       }
     }
   }
   return max;
}

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

   scanf("%d\n", &n);

   for (i = 0; i < n; i++) {
     scanf ("%s", s1);
     scanf ("%s", s2);

     printf("%d\n", lcs(s1, s2));
   }
   return 0;
}

Compiler output:
main.c: In function 'lcs':
main.c:8:15: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
    8 |    m = strlen(X);
      |               ^
      |               |
      |               char
In file included from main.c:2:
/usr/include/string.h:407:35: note: expected 'const char *' but argument is of type 'char'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
main.c:9:15: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
    9 |    n = strlen(Y);
      |               ^
      |               |
      |               char
/usr/include/string.h:407:35: note: expected 'const char *' but argument is of type 'char'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
main.c:19:13: error: subscripted value is neither array nor pointer nor vector
   19 |        if (X[i] == Y[j]) {
      |             ^
main.c:19:21: error: subscripted value is neither array nor pointer nor vector
   19 |        if (X[i] == Y[j]) {
      |                     ^
main.c:31:11: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   31 |    return max;
      |           ^~~
main.c:4:6: note: declared here
    4 | void lcs(char X, char Y) {
      |      ^~~
main.c: In function 'main':
main.c:44:21: error: invalid use of void expression
   44 |      printf("%d\n", lcs(s1, s2));
      |                     ^~~~~~~~~~~
Language: C

#include<stdio.h>
#include<string.h>
#define L 1001
????
int n;
????
int lcs(char X[],char Y[]){
????int i,j,c[L][L];
????int m=strlen(X);
????int 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];
????????}
????}
????return c[m][n];
}
????
int main(){
????int k,U[L];
????char S[L],T[L];
????scanf("%d",&n);
????for(k=0;k<n;k++){
????????scanf("%s",&S);
????????scanf("%s",&T);
????????U[k]=lcs(S,T);
????}
????for(k=0;k<n;k++) printf("%d\n",U[k]);
????return 0;
}

Compiler output:
main.c:4:1: error: expected identifier or '(' before '?' token
    4 | ????
      | ^
main.c:6:1: error: expected identifier or '(' before '?' token
    6 | ????
      | ^
main.c:24:1: error: expected identifier or '(' before '?' token
   24 | ????
      | ^
Language: C

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

int lcs(char X, char Y);

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

   scanf("%d\n", &n);

   for (i = 0; i < n; i++) {
     scanf ("%s", s1);
     scanf ("%s", s2);

     printf("%d\n", lcs(s1, s2));
   }
   return 0;
}

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

   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] == 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[j-1][j];
         } else {
           c[i][j] = c[i][j-1];
         }
       if (max < c[i][j]) {
         max = c[i][j];
       }
     }
   }
   return max;
}

Compiler output:
main.c: In function 'lcs':
main.c:25:15: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
   25 |    m = strlen(X);
      |               ^
      |               |
      |               char
In file included from main.c:2:
/usr/include/string.h:407:35: note: expected 'const char *' but argument is of type 'char'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
main.c:26:15: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
   26 |    n = strlen(Y);
      |               ^
      |               |
      |               char
/usr/include/string.h:407:35: note: expected 'const char *' but argument is of type 'char'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
main.c:36:13: error: subscripted value is neither array nor pointer nor vector
   36 |        if (X[i] == Y[j]) {
      |             ^
main.c:36:21: error: subscripted value is neither array nor pointer nor vector
   36 |        if (X[i] == Y[j]) {
      |                     ^
Language: C

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

 
char X[2000], Y[2000];
 
int main()
{

    int i, j, m, n;
    int a = strlen(X);
    int b = strlen(Y);
    scanf("%d", &m);
    scanf("%d", &n);
    int c[a+1][b+1];
     for(i = 0;i < m;i++){
    scanf("%s", X);
  }
     for(j = 0; j < n; j++){
    scanf("%s", Y);
  }
  
    for(i = 1; i <= n; i++){
    for(j = 1; j <= m; j++){
      if(X[i-1] == Y[j-1]){
      c[i][j] = c[i-1][j-1];
      }
      else if(X[i-1][j] >= Y[i][j-1]){
      c[i][j] = c[i-1][j];
      }
      else{
      c[i][j] = c[i][j-1];
      }
    }
  }
 

Compiler output:
main.c: In function 'main':
main.c:28:21: error: subscripted value is neither array nor pointer nor vector
   28 |       else if(X[i-1][j] >= Y[i][j-1]){
      |                     ^
main.c:28:32: error: subscripted value is neither array nor pointer nor vector
   28 |       else if(X[i-1][j] >= Y[i][j-1]){
      |                                ^
main.c:35:3: error: expected declaration or statement at end of input
   35 |   }
      |   ^
Language: C

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

int lcs(char s1[], char s2[]);

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

   scanf("%d", &n);

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

int lcs(char s1[], char s2[]) {
   int c[1001][1001];
   int i, j, m, n;

   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 (s1[i-1] == s2[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[j-1][j];
         } else {
           c[i][j] = c[i][j-1];
         }
     }
   }
   return c[m][n];
}

Compiler output:
main.c: In function 'lcs':
main.c:24:15: error: 'X' undeclared (first use in this function)
   24 |    m = strlen(X);
      |               ^
main.c:24:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:25:15: error: 'Y' undeclared (first use in this function)
   25 |    n = strlen(Y);
      |               ^
Language: C

#include<stdio.h>
#include<string.h>
????????
int LCS(char *X, char *Y){
????int i,j,m,n,c[1001][1001];
????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+1;i++){
????????for(j=1;j<n+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];
????????}
????}
????return c[i-1][j-1];
}
????????
int main(){
????int i, q;
????char X[1001], Y[1001];
????????????
????scanf("%d", &q);
????for(i=0; i<q; i++){
????????scanf("%s", X);
????????scanf("%s", Y);
????????printf("%d\n", LCS(X, Y));
????????
????}
????return 0;
}

Compiler output:
main.c:3:1: error: expected identifier or '(' before '?' token
    3 | ????????
      | ^
main.c:25:1: error: expected identifier or '(' before '?' token
   25 | ????????
      | ^
Language: C

#include<stdio.h>
#include<string.h>
#define MAX 1001
??
int LCSLength(char [], char []);
??
int main()
{
????int i, q, Z[MAX];
????char X[MAX], Y[MAX];
??
????scanf("%d", &q);
????for(i=0; i<q; i++)
????????{
????????????scanf("%s", X);
????????????scanf("%s", Y);
????????????Z[i] = LCSLength(X, Y);
????????}
??
????for(i=0; i<q; i++)
????????{
????????????printf("%d\n", Z[i]);
????????}
????
????return 0;
}
??
int LCSLength(char X[], char Y[])
{
????int i, j, c[MAX][MAX];
????int m = strlen(X);
????int 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-1] >= 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:4:1: error: expected identifier or '(' before '?' token
    4 | ??
      | ^
main.c:6:1: error: expected identifier or '(' before '?' token
    6 | ??
      | ^
main.c:27:1: error: expected identifier or '(' before '?' token
   27 | ??
      | ^