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

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

int i, j, m, n;

int lcs(char X, char 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(){
  char 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: In function 'lcs':
main.c:9:18: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
    9 |   int 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:10:18: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
   10 |   int 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:25:11: error: subscripted value is neither array nor pointer nor vector
   25 |       if(X[j]==Y[j]){
      |           ^
main.c:25:17: error: subscripted value is neither array nor pointer nor vector
   25 |       if(X[j]==Y[j]){
      |                 ^
Language: C

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

int i, j, m, n;

int lcs(char X, char 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[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 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(){
  char 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: In function 'lcs':
main.c:9:18: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
    9 |   int 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:10:18: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
   10 |   int 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:25:11: error: subscripted value is neither array nor pointer nor vector
   25 |       if(X[i] == Y[j]){
      |           ^
main.c:25:19: error: subscripted value is neither array nor pointer nor vector
   25 |       if(X[i] == Y[j]){
      |                   ^
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[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 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));
      |                    ^~~
Language: C

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

int i, j, m, n;

int lcs(char X, char 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[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 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(){
  char s1, s2;

  scanf("%d", &n);

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

  return 0;
}

Compiler output:
main.c: In function 'lcs':
main.c:9:18: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
    9 |   int 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:10:18: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
   10 |   int 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:25:11: error: subscripted value is neither array nor pointer nor vector
   25 |       if(X[i] == Y[j]){
      |           ^
main.c:25:19: error: subscripted value is neither array nor pointer nor vector
   25 |       if(X[i] == Y[j]){
      |                   ^
main.c: In function 'main':
main.c:47:24: error: expected expression before ']' token
   47 |     scanf("%s %s", &s1[], &s2[]);
      |                        ^
Language: C

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

int i, j, m, n;

int lcs(char X, char 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[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 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(){
  char s1, s2;

  scanf("%d", &n);

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

  return 0;
}

Compiler output:
main.c: In function 'lcs':
main.c:9:18: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
    9 |   int 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:10:18: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
   10 |   int 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:25:11: error: subscripted value is neither array nor pointer nor vector
   25 |       if(X[i] == Y[j]){
      |           ^
main.c:25:19: error: subscripted value is neither array nor pointer nor vector
   25 |       if(X[i] == Y[j]){
      |                   ^
Language: C

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

int i, j, m, n;

int lcs(char X, char 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[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 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(){
  char s1, s2;

  scanf("%d", &n);

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

  return 0;
}

Compiler output:
main.c: In function 'lcs':
main.c:9:18: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
    9 |   int 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:10:18: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
   10 |   int 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:25:12: error: subscripted value is neither array nor pointer nor vector
   25 |       if(*X[i] == *Y[j]){
      |            ^
main.c:25:21: error: subscripted value is neither array nor pointer nor vector
   25 |       if(*X[i] == *Y[j]){
      |                     ^
Language: C

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

int i, j, m, n;

int lcs(char X, char 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[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 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(){
  char s1, s2;

  scanf("%d", &n);

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

  return 0;
}

Compiler output:
main.c: In function 'lcs':
main.c:9:18: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
    9 |   int 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:10:18: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
   10 |   int 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:25:12: error: subscripted value is neither array nor pointer nor vector
   25 |       if(&X[i] == &Y[j]){
      |            ^
main.c:25:21: error: subscripted value is neither array nor pointer nor vector
   25 |       if(&X[i] == &Y[j]){
      |                     ^
Language: C

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

int i, j, max = 0;
   
int lcs(char X[], char Y[]) {
  int common[1000][1000], x, y;
  
  x = strlen(X);
  y = strlen(Y);
  
  for(i = 0; i <= x; i++)
    common[i][0] = 0;
  for(j = 0; j <= y; j++)
    common[0][j] = 0;
    
  for(i = 1; i <= x; i++){
    for(j = 1; j <= y; j++){
      
      if(X[i-1] == Y[j-1])
        common[i][j] = common[i-1][j-1] + 1;
      else if(common[i-1][j] > common[i][j-1])
        common[i][j] = common[i-1][j];
      else
        common[i][j] = common[i][j-1];
        
    }
    if(max < common[i][j])
      max = common[i][j];
  }
  return max;
}
   
int main() {
  int n, q[150];
  char X[1000], Y[1000];
  
  scanf("%d", &n);
  for (i = 0; i < n; i++){
    scanf("%s", X);scanf("%s", Y);a
    q[i] = lcs(X, Y);
  }
       
  for ( i = 0; i < n; i++ ){
    printf("%d\n", q[i]);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:40:35: error: unknown type name 'a'
   40 |     scanf("%s", X);scanf("%s", Y);a
      |                                   ^
main.c:41:12: error: variable-sized object may not be initialized except with an empty initializer
   41 |     q[i] = lcs(X, Y);
      |            ^~~
Language: C

#include <stdio.h>
#include <string.h>
char X[1001];
char Y[1001];
int c[1001][1001];
int n;

int lcs(){
  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];
     }
    }
   }
  return c[m][n];
}
??
int main(){
  scanf("%d",&n);
  int i;
  for(i=0;i<n;i++){
    scanf("%s",X);
    scanf("%s",Y);


   printf("%d\n",lcs());
  }

  return 0;
}

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

#include <stdio.h>
#include <string.h>
char X[1001];
char Y[1001];
int c[1001][1001];
int n;
??
int lcs(){
????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];
??????????}
????????}
??????}
????return c[m][n];
}


int main(){
????scanf("%d",&n);
????int i;
????for(i=0;i<n;i++){
????????scanf("%s",X);
????????scanf("%s",Y);
??
??
??????printf("%d\n",lcs());
????}
??
????return 0;
}

Compiler output:
main.c:7:1: error: expected identifier or '(' before '?' token
    7 | ??
      | ^
main.c: In function 'main':
main.c:34:1: error: expected expression before '?' token
   34 | ????scanf("%d",&n);
      | ^
main.c:35:1: error: expected expression before '?' token
   35 | ????int i;
      | ^
main.c:36:1: error: expected expression before '?' token
   36 | ????for(i=0;i<n;i++){
      | ^
Language: C


#include<stdio.h>
#include<string.h>
#define N 1001
int lcslength(char [] ,char []);
char X[N],Y[N];
int a[N][N];
int x,y;
int main(){
????int n,i;
????
????scanf("%d",&n);
??????
????for(i=1;i<=n;i++){
????????scanf("%s %s",X,Y);
??????
????????printf("%d\n",lcslength(X,Y));
??????????
}
????????
????????
????return 0;
}
????
int lcslength(char X[] ,char Y[]){
????int i,j;
????
????????
????for(i=1;i<=stlen(x);i++){
????????a[i][0] = 0;
????}
????for(j=0;j<=stlen(y);j++){
????????a[0][j] = 0;
????}
????????
????for(i=1;i<=stlen(x);i++){
????????for(j=1;j<=stlen(y);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 a[stlen(x)][stlen(y)];
}

Compiler output:
main.c: In function 'main':
main.c:10:1: error: expected expression before '?' token
   10 | ????int n,i;
      | ^
main.c:11:1: error: expected expression before '?' token
   11 | ????
      | ^
main.c:12:17: error: 'n' undeclared (first use in this function)
   12 | ????scanf("%d",&n);
      |                 ^
main.c:12:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:1: error: expected expression before '?' token
   13 | ??????
      | ^
main.c: At top level:
main.c:24:1: error: expected identifier or '(' before '?' token
   24 | ????
      | ^
Language: C


#include<stdio.h>
#include<string.h>
#define N 1001
int lcslength(char [] ,char []);
char X[N],Y[N];
int a[N][N];
int x,y;
int main(){
int n,i;

scanf("%d",&n);

for(i=1;i<=n;i++){
scanf("%s %s",X,Y);
printf("%d\n",lcslength(X,Y));

}
????return 0;
}
int lcslength(char X[] ,char Y[]){
??int i,j;
??for(i=1;i<=stlen(x);i++){
a[i][0] = 0;
}
for(j=0;j<=stlen(y);j++){
a[0][j] = 0;
??}
??for(i=1;i<=stlen(x);i++){
??for(j=1;j<=stlen(y);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 a[stlen(x)][stlen(y)];
}

Compiler output:
main.c: In function 'main':
main.c:19:1: error: expected expression before '?' token
   19 | ????return 0;
      | ^
main.c: In function 'lcslength':
main.c:22:1: error: expected expression before '?' token
   22 | ??int i,j;
      | ^
main.c:23:1: error: expected expression before '?' token
   23 | ??for(i=1;i<=stlen(x);i++){
      | ^
Language: C


#include<stdio.h>
#include<string.h>
#define N 1001
int lcslength(char [] ,char []);
char X[N],Y[N];
int a[N][N];
int x,y;
int main(){
int n,i;
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%s %s",X,Y);
printf("%d\n",lcslength(X,Y));
}
return 0;
}
int lcslength(char X[] ,char Y[]){
int i,j;
for(i=1;i<=stlen(x);i++){
a[i][0] = 0;
}
for(j=0;j<=stlen(y);j++){
a[0][j] = 0;
}
for(i=1;i<=stlen(x);i++){
for(j=1;j<=stlen(y);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 a[stlen(x)][stlen(y)];
}

Compiler output:
main.c: In function 'lcslength':
main.c:20:12: error: implicit declaration of function 'stlen'; did you mean 'strlen'? [-Wimplicit-function-declaration]
   20 | for(i=1;i<=stlen(x);i++){
      |            ^~~~~
      |            strlen
Language: C

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

char x[1000],y[1000];

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

 for(i=1;i<=n;i++){
   a[i][0]=0;
 }

 for(i=0;i<=m;i++){
   a[0][i]=0;
 }

 for(i=1;i<=n;i++){
  for(j=1;j<=m;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];
   }
  }
 }
 returna[n][m];
}

int main(void)
{
 int i,n;

 scanf("%d",&n);

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

 return 0;
}

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

#include <stdio.h>
#include <string.h>
??
char x[1000],y[1000];
??
int LCS()
{
??int i,j;
??int n=strlen(x),m=strlen(y);
??int a[n+1][m+1];
??
??for(i=1;i<=n;i++){
??????a[i][0]=0;
??}
??
??for(i=0;i<=m;i++){
??????a[0][i]=0;
??}
??
??for(i=1;i<=n;i++){
????for(j=1;j<=m;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 a[n][m];
}
??
int main(void)
{
??int i,n;
??
??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 | ??
      | ^
main.c:5:1: error: expected identifier or '(' before '?' token
    5 | ??
      | ^
main.c:33:1: error: expected identifier or '(' before '?' token
   33 | ??
      | ^
Language: C

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

char x[1000],y[1000];

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

 for(i=1;i<=n;i++){
   a[i][0]=0;
 }

??for(i=0;i<=m;i++){
??????a[0][i]=0;
??}

??for(i=1;i<=n;i++){
????for(j=1;j<=m;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 a[n][m];
}

int main(void)
{
??int i,n;

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

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

??return 0;
}

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

#include <stdio.h>

int c[1001][1001];

int lcs(char X[],char Y[],int m,int n)

  int i,j,max;
  max=0;
  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]==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(max>c[i][j]){
      max=c[i][j];
    }
  }
  return max;
}
int length(const char s[])
{
  int len;
  len=0;
  while(s[len]){
    len++;
  return len;
}

int main(void)
{
  int N;
  char m[1001],n[1001],max[151];
  
  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%s",&m);
    scanf("%s",&n);
    max[i]=ics(length(m),length(n),m,n);
    printf("%d\n",max[i]);
  }
  return 0;
}

Compiler output:
main.c: In function 'lcs':
main.c:8:3: error: expected declaration specifiers before 'max'
    8 |   max=0;
      |   ^~~
main.c:9:3: error: expected declaration specifiers before 'for'
    9 |   for(i=0;i<=m;i++){
      |   ^~~
main.c:9:11: error: expected declaration specifiers before 'i'
    9 |   for(i=0;i<=m;i++){
      |           ^
main.c:9:16: error: expected declaration specifiers before 'i'
    9 |   for(i=0;i<=m;i++){
      |                ^
main.c:12:3: error: expected declaration specifiers before 'for'
   12 |   for(j=1;j<=n;j++){
      |   ^~~
main.c:12:11: error: expected declaration specifiers before 'j'
   12 |   for(j=1;j<=n;j++){
      |           ^
main.c:12:16: error: expected declaration specifiers before 'j'
   12 |   for(j=1;j<=n;j++){
      |                ^
main.c:15:3: error: expected declaration specifiers before 'for'
   15 |   for(i=1;i<=m;i++){
      |   ^~~
main.c:15:11: error: expected declaration specifiers before 'i'
   15 |   for(i=1;i<=m;i++){
      |           ^
main.c:15:16: error: expected declaration specifiers before 'i'
   15 |   for(i=1;i<=m;i++){
      |                ^
main.c:33:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   33 | {
      | ^
main.c:5:5: error: old-style parameter declarations in prototyped function definition
    5 | int lcs(char X[],char Y[],int m,int n)
      |     ^~~
Language: C

#include <stdio.h>

int c[1001][1001];

int length(const char s[])
{
  int len;
  len=0;
  while(s[len]){
    len++;
  return len;
}

int lcs(char X[],char Y[],int m,int n)

  int i,j,max;
  max=0;
  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]==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(max>c[i][j]){
      max=c[i][j];
    }
  }
  return max;
}

int main(void)
{
  int N;
  char m[1001],n[1001],max[151];
  
  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%s",&m);
    scanf("%s",&n);
    max[i]=ics(length(m),length(n),m,n);
    printf("%d\n",max[i]);
  }
  return 0;
}

Compiler output:
main.c: In function 'lcs':
main.c:17:3: error: expected declaration specifiers before 'max'
   17 |   max=0;
      |   ^~~
main.c:18:3: error: expected declaration specifiers before 'for'
   18 |   for(i=0;i<=m;i++){
      |   ^~~
main.c:18:11: error: expected declaration specifiers before 'i'
   18 |   for(i=0;i<=m;i++){
      |           ^
main.c:18:16: error: expected declaration specifiers before 'i'
   18 |   for(i=0;i<=m;i++){
      |                ^
main.c:21:3: error: expected declaration specifiers before 'for'
   21 |   for(j=1;j<=n;j++){
      |   ^~~
main.c:21:11: error: expected declaration specifiers before 'j'
   21 |   for(j=1;j<=n;j++){
      |           ^
main.c:21:16: error: expected declaration specifiers before 'j'
   21 |   for(j=1;j<=n;j++){
      |                ^
main.c:24:3: error: expected declaration specifiers before 'for'
   24 |   for(i=1;i<=m;i++){
      |   ^~~
main.c:24:11: error: expected declaration specifiers before 'i'
   24 |   for(i=1;i<=m;i++){
      |           ^
main.c:24:16: error: expected declaration specifiers before 'i'
   24 |   for(i=1;i<=m;i++){
      |                ^
main.c:43:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   43 | {
      | ^
main.c:14:5: error: old-style parameter declarations in prototyped function definition
   14 | int lcs(char X[],char Y[],int m,int n)
      |     ^~~
main.c:56: error: expected '{' at end of input
main.c: In function 'length':
main.c:55:1: error: expected declaration or statement at end of input
   55 | }
      | ^
Language: C

#include <stdio.h>

int c[1001][1001];

int length(const char s[])
{
  int len;
  len=0;
  while(s[len]){
    len++;
  return len;
}

int lcs(char X[],char Y[],int m,int n)
??
????int i,j,max1;
????max1=0;
????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]==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(max1>c[i][j]){
????????????max1=c[i][j];
????????}
????}
  return max1;
}
??
int main(void)
{
????int N;
????char m[1001],n[1001],max[151];
??????
????scanf("%d",&N);
????for(i=0;i<N;i++){
????????scanf("%s",&m);
????????scanf("%s",&n);
????????max[i]=ics(length(m[i]),length(n[i]),m,n);
????????printf("%d\n",max[i]);
????}
  return 0;
}

Compiler output:
main.c: In function 'lcs':
main.c:15:1: error: expected declaration specifiers before '?' token
   15 | ??
      | ^
main.c:17:1: error: expected declaration specifiers before '?' token
   17 | ????max1=0;
      | ^
main.c:18:1: error: expected declaration specifiers before '?' token
   18 | ????for(i=0;i<=m;i++){
      | ^
main.c:18:13: error: expected declaration specifiers before 'i'
   18 | ????for(i=0;i<=m;i++){
      |             ^
main.c:18:18: error: expected declaration specifiers before 'i'
   18 | ????for(i=0;i<=m;i++){
      |                  ^
main.c:21:1: error: expected declaration specifiers before '?' token
   21 | ????for(j=1;j<=n;j++){
      | ^
main.c:21:13: error: expected declaration specifiers before 'j'
   21 | ????for(j=1;j<=n;j++){
      |             ^
main.c:21:18: error: expected declaration specifiers before 'j'
   21 | ????for(j=1;j<=n;j++){
      |                  ^
main.c:24:1: error: expected declaration specifiers before '?' token
   24 | ????for(i=1;i<=m;i++){
      | ^
main.c:24:13: error: expected declaration specifiers before 'i'
   24 | ????for(i=1;i<=m;i++){
      |             ^
main.c:24:18: error: expected declaration specifiers before 'i'
   24 | ????for(i=1;i<=m;i++){
      |                  ^
main.c:41:1: error: expected declaration specifiers before '?' token
   41 | ??
      | ^
main.c:56: error: expected '{' at end of input
main.c: In function 'length':
main.c:55:1: error: expected declaration or statement at end of input
   55 | }
      | ^
Language: C

#include <stdio.h>

int c[1001][1001];

int length(const char s[])
{
  int len;
  len=0;
  while(s[len]){
    len++;
  return len;
}

int lcs(char X[],char Y[],int m,int n)

  int i,j,max1;
  max1=0;
  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]==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(max1>c[i][j]){
      max1=c[i][j];
    }
  }
  return max1;
}

int main(void)
{
  int N;
  char m[1001],n[1001],max[151];

  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%s",&m);
    scanf("%s",&n);
    max[i]=ics(length(m[i]),length(n[i]),m,n);
    printf("%d\n",max[i]);
  }
  return 0;
}

Compiler output:
main.c: In function 'lcs':
main.c:17:3: error: expected declaration specifiers before 'max1'
   17 |   max1=0;
      |   ^~~~
main.c:18:3: error: expected declaration specifiers before 'for'
   18 |   for(i=0;i<=m;i++){
      |   ^~~
main.c:18:11: error: expected declaration specifiers before 'i'
   18 |   for(i=0;i<=m;i++){
      |           ^
main.c:18:16: error: expected declaration specifiers before 'i'
   18 |   for(i=0;i<=m;i++){
      |                ^
main.c:21:3: error: expected declaration specifiers before 'for'
   21 |   for(j=1;j<=n;j++){
      |   ^~~
main.c:21:11: error: expected declaration specifiers before 'j'
   21 |   for(j=1;j<=n;j++){
      |           ^
main.c:21:16: error: expected declaration specifiers before 'j'
   21 |   for(j=1;j<=n;j++){
      |                ^
main.c:24:3: error: expected declaration specifiers before 'for'
   24 |   for(i=1;i<=m;i++){
      |   ^~~
main.c:24:11: error: expected declaration specifiers before 'i'
   24 |   for(i=1;i<=m;i++){
      |           ^
main.c:24:16: error: expected declaration specifiers before 'i'
   24 |   for(i=1;i<=m;i++){
      |                ^
main.c:43:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   43 | {
      | ^
main.c:14:5: error: old-style parameter declarations in prototyped function definition
   14 | int lcs(char X[],char Y[],int m,int n)
      |     ^~~
main.c:56: error: expected '{' at end of input
main.c: In function 'length':
main.c:55:1: error: expected declaration or statement at end of input
   55 | }
      | ^
Language: C

#include <stdio.h>

int c[1001][1001];

int length(const char s[])
{
  int len;
  len=0;
  while(s[len]){
    len++;
  return len;
}

int lcs(char X[],char Y[],int m,int n)

  int i,j,max1;
  max1=0;
  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]==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(max1>c[i][j]){
      max1=c[i][j];
    }
  }
  return max1;
}

int main(void)
{
  int N;
  char m[1001],n[1001],max[151];

  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%s",&m);
    scanf("%s",&n);
    max[i]=lcs(length(m[i]),length(n[i]),m,n);
    printf("%d\n",max[i]);
  }
  return 0;
}

Compiler output:
main.c: In function 'lcs':
main.c:17:3: error: expected declaration specifiers before 'max1'
   17 |   max1=0;
      |   ^~~~
main.c:18:3: error: expected declaration specifiers before 'for'
   18 |   for(i=0;i<=m;i++){
      |   ^~~
main.c:18:11: error: expected declaration specifiers before 'i'
   18 |   for(i=0;i<=m;i++){
      |           ^
main.c:18:16: error: expected declaration specifiers before 'i'
   18 |   for(i=0;i<=m;i++){
      |                ^
main.c:21:3: error: expected declaration specifiers before 'for'
   21 |   for(j=1;j<=n;j++){
      |   ^~~
main.c:21:11: error: expected declaration specifiers before 'j'
   21 |   for(j=1;j<=n;j++){
      |           ^
main.c:21:16: error: expected declaration specifiers before 'j'
   21 |   for(j=1;j<=n;j++){
      |                ^
main.c:24:3: error: expected declaration specifiers before 'for'
   24 |   for(i=1;i<=m;i++){
      |   ^~~
main.c:24:11: error: expected declaration specifiers before 'i'
   24 |   for(i=1;i<=m;i++){
      |           ^
main.c:24:16: error: expected declaration specifiers before 'i'
   24 |   for(i=1;i<=m;i++){
      |                ^
main.c:43:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   43 | {
      | ^
main.c:14:5: error: old-style parameter declarations in prototyped function definition
   14 | int lcs(char X[],char Y[],int m,int n)
      |     ^~~
main.c:56: error: expected '{' at end of input
main.c: In function 'length':
main.c:55:1: error: expected declaration or statement at end of input
   55 | }
      | ^
Language: C

#include <stdio.h>

int c[1001][1001];

int length(const char s[])
{
  int len;
  len=0;
  while(s[len]){
    len++;
  return len;
}

int lcs(char X[],char Y[],int m,int n)

  int i,j,max1;
  max1=0;
  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]==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(max1>c[i][j]){
      max1=c[i][j];
    }
  }
  return max1;
}

int main(void)
{
  int N;
  char m[1001],n[1001],max[151];

  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%s",&m[i]);
    scanf("%s",&n[i]);
    max[i]=ics(length(m[i]),length(n[i]),m,n);
    printf("%d\n",max[i]);
  }
  return 0;
}

Compiler output:
main.c: In function 'lcs':
main.c:17:3: error: expected declaration specifiers before 'max1'
   17 |   max1=0;
      |   ^~~~
main.c:18:3: error: expected declaration specifiers before 'for'
   18 |   for(i=0;i<=m;i++){
      |   ^~~
main.c:18:11: error: expected declaration specifiers before 'i'
   18 |   for(i=0;i<=m;i++){
      |           ^
main.c:18:16: error: expected declaration specifiers before 'i'
   18 |   for(i=0;i<=m;i++){
      |                ^
main.c:21:3: error: expected declaration specifiers before 'for'
   21 |   for(j=1;j<=n;j++){
      |   ^~~
main.c:21:11: error: expected declaration specifiers before 'j'
   21 |   for(j=1;j<=n;j++){
      |           ^
main.c:21:16: error: expected declaration specifiers before 'j'
   21 |   for(j=1;j<=n;j++){
      |                ^
main.c:24:3: error: expected declaration specifiers before 'for'
   24 |   for(i=1;i<=m;i++){
      |   ^~~
main.c:24:11: error: expected declaration specifiers before 'i'
   24 |   for(i=1;i<=m;i++){
      |           ^
main.c:24:16: error: expected declaration specifiers before 'i'
   24 |   for(i=1;i<=m;i++){
      |                ^
main.c:43:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   43 | {
      | ^
main.c:14:5: error: old-style parameter declarations in prototyped function definition
   14 | int lcs(char X[],char Y[],int m,int n)
      |     ^~~
main.c:56: error: expected '{' at end of input
main.c: In function 'length':
main.c:55:1: error: expected declaration or statement at end of input
   55 | }
      | ^
Language: C

#include <stdio.h>

int c[1001][1001];

int length(const char *s[])
{
  int len;
  len=0;
  while(s[len]){
    len++;
  return len;
}

int lcs(char X[],char Y[],int m,int n)

  int i,j,max1;
  max1=0;
  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]==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(max1>c[i][j]){
      max1=c[i][j];
    }
  }
  return max1;
}

int main(void)
{
  int N;
  char m[1001],n[1001],max[151];

  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%s",&m[i]);
    scanf("%s",&n[i]);
    max[i]=ics(length(m[i]),length(n[i]),m,n);
    printf("%d\n",max[i]);
  }
  return 0;
}

Compiler output:
main.c: In function 'lcs':
main.c:17:3: error: expected declaration specifiers before 'max1'
   17 |   max1=0;
      |   ^~~~
main.c:18:3: error: expected declaration specifiers before 'for'
   18 |   for(i=0;i<=m;i++){
      |   ^~~
main.c:18:11: error: expected declaration specifiers before 'i'
   18 |   for(i=0;i<=m;i++){
      |           ^
main.c:18:16: error: expected declaration specifiers before 'i'
   18 |   for(i=0;i<=m;i++){
      |                ^
main.c:21:3: error: expected declaration specifiers before 'for'
   21 |   for(j=1;j<=n;j++){
      |   ^~~
main.c:21:11: error: expected declaration specifiers before 'j'
   21 |   for(j=1;j<=n;j++){
      |           ^
main.c:21:16: error: expected declaration specifiers before 'j'
   21 |   for(j=1;j<=n;j++){
      |                ^
main.c:24:3: error: expected declaration specifiers before 'for'
   24 |   for(i=1;i<=m;i++){
      |   ^~~
main.c:24:11: error: expected declaration specifiers before 'i'
   24 |   for(i=1;i<=m;i++){
      |           ^
main.c:24:16: error: expected declaration specifiers before 'i'
   24 |   for(i=1;i<=m;i++){
      |                ^
main.c:43:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   43 | {
      | ^
main.c:14:5: error: old-style parameter declarations in prototyped function definition
   14 | int lcs(char X[],char Y[],int m,int n)
      |     ^~~
main.c:56: error: expected '{' at end of input
main.c: In function 'length':
main.c:55:1: error: expected declaration or statement at end of input
   55 | }
      | ^
Language: C

#include <stdio.h>

int c[1001][1001];

int length(const char *s[])
{
  int len;
  len=0;
  while(*s[len]){
    len++;
  }
  return len;
}

int lcs(char X[],char Y[],int m,int n)

  int i,j,max1;
  max1=0;
  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]==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(max1>c[i][j]){
      max1=c[i][j];
    }
  }
  return max1;
}

int main(void)
{
  int N;
  char m[1001],n[1001],max[151];

  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%s",&m[i]);
    scanf("%s",&n[i]);
    max[i]=ics(length(m[i]),length(n[i]),m,n);
    printf("%d\n",max[i]);
  }
  return 0;
}

Compiler output:
main.c: In function 'lcs':
main.c:18:3: error: expected declaration specifiers before 'max1'
   18 |   max1=0;
      |   ^~~~
main.c:19:3: error: expected declaration specifiers before 'for'
   19 |   for(i=0;i<=m;i++){
      |   ^~~
main.c:19:11: error: expected declaration specifiers before 'i'
   19 |   for(i=0;i<=m;i++){
      |           ^
main.c:19:16: error: expected declaration specifiers before 'i'
   19 |   for(i=0;i<=m;i++){
      |                ^
main.c:22:3: error: expected declaration specifiers before 'for'
   22 |   for(j=1;j<=n;j++){
      |   ^~~
main.c:22:11: error: expected declaration specifiers before 'j'
   22 |   for(j=1;j<=n;j++){
      |           ^
main.c:22:16: error: expected declaration specifiers before 'j'
   22 |   for(j=1;j<=n;j++){
      |                ^
main.c:25:3: error: expected declaration specifiers before 'for'
   25 |   for(i=1;i<=m;i++){
      |   ^~~
main.c:25:11: error: expected declaration specifiers before 'i'
   25 |   for(i=1;i<=m;i++){
      |           ^
main.c:25:16: error: expected declaration specifiers before 'i'
   25 |   for(i=1;i<=m;i++){
      |                ^
main.c:44:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   44 | {
      | ^
main.c:15:5: error: old-style parameter declarations in prototyped function definition
   15 | int lcs(char X[],char Y[],int m,int n)
      |     ^~~
main.c:57: error: expected '{' at end of input
Language: C

#include <stdio.h>

int c[1001][1001];

int length(const char *s[])
{
  int len;
  len=0;
  while(*s[len]){
    len++;
  }
  return len;
}

int lcs(char X[],char Y[],int m,int n)

  int i,j,max1;
  max1=0;
  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]==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(max1>c[i][j]){
      max1=c[i][j];
    }
  }
  return max1;
}

int main(void)
{
  int N,max[151];
  char m[1001],n[1001];

  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%s",&m[i]);
    scanf("%s",&n[i]);
    max[i]=ics(length(m[i]),length(n[i]),m,n);
    printf("%d\n",max[i]);
  }
  return 0;
}

Compiler output:
main.c: In function 'lcs':
main.c:18:3: error: expected declaration specifiers before 'max1'
   18 |   max1=0;
      |   ^~~~
main.c:19:3: error: expected declaration specifiers before 'for'
   19 |   for(i=0;i<=m;i++){
      |   ^~~
main.c:19:11: error: expected declaration specifiers before 'i'
   19 |   for(i=0;i<=m;i++){
      |           ^
main.c:19:16: error: expected declaration specifiers before 'i'
   19 |   for(i=0;i<=m;i++){
      |                ^
main.c:22:3: error: expected declaration specifiers before 'for'
   22 |   for(j=1;j<=n;j++){
      |   ^~~
main.c:22:11: error: expected declaration specifiers before 'j'
   22 |   for(j=1;j<=n;j++){
      |           ^
main.c:22:16: error: expected declaration specifiers before 'j'
   22 |   for(j=1;j<=n;j++){
      |                ^
main.c:25:3: error: expected declaration specifiers before 'for'
   25 |   for(i=1;i<=m;i++){
      |   ^~~
main.c:25:11: error: expected declaration specifiers before 'i'
   25 |   for(i=1;i<=m;i++){
      |           ^
main.c:25:16: error: expected declaration specifiers before 'i'
   25 |   for(i=1;i<=m;i++){
      |                ^
main.c:44:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   44 | {
      | ^
main.c:15:5: error: old-style parameter declarations in prototyped function definition
   15 | int lcs(char X[],char Y[],int m,int n)
      |     ^~~
main.c:57: error: expected '{' at end of input
Language: C

#include <stdio.h>

int c[1001][1001];

int length(const char *s[])
{
  int len;
  len=0;
  while(*s[len]){
    len++;
  }
  return len;
}

int lcs(char X[],char Y[],int m,int n)

  int i,j,max1;
  max1=0;
  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]==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(max1>c[i][j]){
      max1=c[i][j];
    }
  }
  return max1;
}

int main(void)
{
  int N,max[151];
  char m[1001],n[1001];

  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%s",&m[i]);
    scanf("%s",&n[i]);
    max[i]=ics(length(&m[i]),length(&n[i]),m,n);
    printf("%d\n",max[i]);
  }
  return 0;
}

Compiler output:
main.c: In function 'lcs':
main.c:18:3: error: expected declaration specifiers before 'max1'
   18 |   max1=0;
      |   ^~~~
main.c:19:3: error: expected declaration specifiers before 'for'
   19 |   for(i=0;i<=m;i++){
      |   ^~~
main.c:19:11: error: expected declaration specifiers before 'i'
   19 |   for(i=0;i<=m;i++){
      |           ^
main.c:19:16: error: expected declaration specifiers before 'i'
   19 |   for(i=0;i<=m;i++){
      |                ^
main.c:22:3: error: expected declaration specifiers before 'for'
   22 |   for(j=1;j<=n;j++){
      |   ^~~
main.c:22:11: error: expected declaration specifiers before 'j'
   22 |   for(j=1;j<=n;j++){
      |           ^
main.c:22:16: error: expected declaration specifiers before 'j'
   22 |   for(j=1;j<=n;j++){
      |                ^
main.c:25:3: error: expected declaration specifiers before 'for'
   25 |   for(i=1;i<=m;i++){
      |   ^~~
main.c:25:11: error: expected declaration specifiers before 'i'
   25 |   for(i=1;i<=m;i++){
      |           ^
main.c:25:16: error: expected declaration specifiers before 'i'
   25 |   for(i=1;i<=m;i++){
      |                ^
main.c:44:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   44 | {
      | ^
main.c:15:5: error: old-style parameter declarations in prototyped function definition
   15 | int lcs(char X[],char Y[],int m,int n)
      |     ^~~
main.c:57: error: expected '{' at end of input
Language: C

#include <stdio.h>

int c[1001][1001];

int length(const char *s[])
{
  int len;
  len=0;
  while(*s[len]++){
    len++;
  }
  return len;
}

int lcs(char X[],char Y[],int m,int n)

  int i,j,max1;
  max1=0;
  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]==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(max1>c[i][j]){
      max1=c[i][j];
    }
  }
  return max1;
}

int main()
{
  int N,max[151],ml,nl;
  char m[1001],n[1001];

  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%s",&m[i]);
    scanf("%s",&n[i]);
    ml=length(m);
    nl=length(n);
    max[i]=ics(ml,nl,m,n);
    printf("%d\n",max[i]);
  }
  return 0;
}

Compiler output:
main.c: In function 'lcs':
main.c:18:3: error: expected declaration specifiers before 'max1'
   18 |   max1=0;
      |   ^~~~
main.c:19:3: error: expected declaration specifiers before 'for'
   19 |   for(i=0;i<=m;i++){
      |   ^~~
main.c:19:11: error: expected declaration specifiers before 'i'
   19 |   for(i=0;i<=m;i++){
      |           ^
main.c:19:16: error: expected declaration specifiers before 'i'
   19 |   for(i=0;i<=m;i++){
      |                ^
main.c:22:3: error: expected declaration specifiers before 'for'
   22 |   for(j=1;j<=n;j++){
      |   ^~~
main.c:22:11: error: expected declaration specifiers before 'j'
   22 |   for(j=1;j<=n;j++){
      |           ^
main.c:22:16: error: expected declaration specifiers before 'j'
   22 |   for(j=1;j<=n;j++){
      |                ^
main.c:25:3: error: expected declaration specifiers before 'for'
   25 |   for(i=1;i<=m;i++){
      |   ^~~
main.c:25:11: error: expected declaration specifiers before 'i'
   25 |   for(i=1;i<=m;i++){
      |           ^
main.c:25:16: error: expected declaration specifiers before 'i'
   25 |   for(i=1;i<=m;i++){
      |                ^
main.c:44:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   44 | {
      | ^
main.c:15:5: error: old-style parameter declarations in prototyped function definition
   15 | int lcs(char X[],char Y[],int m,int n)
      |     ^~~
main.c:59: error: expected '{' at end of input