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

#include<stdio.h>

int main(){
	int search(int A[],int n,int key){
	int i=0;
	A[n]=key;
	while(A[i] != key)
		i++;
	return i != n;
}

int main(){
	int i,n,A[10000],q,key,sum=0;

	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d", &A[i]);

	scanf("%d",&q);
	for(i=0;i<q;i++){
		scanf("%d",&key);
		if(seach(A,n,key))
			sum++;
	}
	printf("%d\n",sum);

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:22:20: error: implicit declaration of function 'seach'; did you mean 'search'? [-Wimplicit-function-declaration]
   22 |                 if(seach(A,n,key))
      |                    ^~~~~
      |                    search
main.c: In function 'main':
main.c:28:1: error: expected declaration or statement at end of input
   28 | }
      | ^
Language: C

#include<stdio.h>

int search(int A[],int n,int key){
	int i=0;
	A[n]=key;
	while(A[i] != key)
		i++;
	return i != n;
}

int main(){
	int i,n,A[10000],q,key,sum=0;

	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d", &A[i]);

	scanf("%d",&q);
	for(i=0;i<q;i++){
		scanf("%d",&key);
		if(seach(A,n,key))
			sum++;
	}
	printf("%d\n",sum);

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:21:20: error: implicit declaration of function 'seach'; did you mean 'search'? [-Wimplicit-function-declaration]
   21 |                 if(seach(A,n,key))
      |                    ^~~~~
      |                    search
Language: C

#include <stdio.h>

int search(int A[], int n, int key) {

   int i = 0;
   A[n] = key;

   while (A[i] != key) i++;
   return i != n;
}

int main() {
   int i, n, A[10000+1], q, key, sum = 0;

   scanf("%d", &n);
   for(i = 0;i < n; i++)
   scanf("%d", &A[i]);

   scanf("%d", &q);
   for (i = 0;i < q; i++) {
    scanf ("%d", &key);
    if (search(A, n, key)) sum++;
   }

    printf("%d\n", sum)
    return  0;
}

Compiler output:
main.c: In function 'main':
main.c:25:24: error: expected ';' before 'return'
   25 |     printf("%d\n", sum)
      |                        ^
      |                        ;
   26 |     return  0;
      |     ~~~~~~
Language: C

#include <stdio.h>

int main() {
  int i, j;
  int n, q, count;
  int c[10000], t[500];

  scanf ("%d", &n);
  for (i = 0 ;i < n ; i++) {
    if (i > 0)
      printf (" ");
    scanf ("%d", &c[i]);
  }
  scanf ("%d", &q);
  for (i = 0 ;i < n ; i++) {
    if (i > 0)
      printf (" ");
    scanf ("%d", &q[i]);
  }

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

  printf ("%d\n", count);

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:18:20: error: subscripted value is neither array nor pointer nor vector
   18 |     scanf ("%d", &q[i]);
      |                    ^
main.c:21:12: error: expected ';' before 'for'
   21 |   count = 0
      |            ^
      |            ;
   22 |   for (i = 0 ;i < n ; i++) {
      |   ~~~
Language: C

#include <stdio.h>
  
int main()
{
   int n, S[10000], q, T[500], c;
   c = 0;
 
   scanf("%d", &n);
   for (i = 0; i < n; i++)
      scanf("%d", &S[i]);
   scanf("%d", &q);
   for (i = 0; i < q; i++)
      scanf("%d", &T[i]);

   for (i = 0; i < n; i++) {
      for (j = 0; j < n;j++) {
         if (S[i] == T[j])
            c++;
      }
   }
   
   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:9: error: 'i' undeclared (first use in this function)
    9 |    for (i = 0; i < n; i++)
      |         ^
main.c:9:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:12: error: 'j' undeclared (first use in this function)
   16 |       for (j = 0; j < n;j++) {
      |            ^
Language: C

#include <stdio.h>

int main()
{
    int n,q,s[],t[],i,j;
    int c = 0;

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

    scanf ("%d",&q);
    for (i=0; i<q; i++) {
      scanf ("%d",&t[i]);
    }

    for (i=0; i<n; i++) {
      for (j=0; j<q; j++) {
        if (s[i] == t[j]) {
        c++;
        } else {
        c = 0;
        }
      }
    }

    printf ("%d\n",c);

    return 0;
} 

Compiler output:
main.c: In function 'main':
main.c:5:13: error: array size missing in 's'
    5 |     int n,q,s[],t[],i,j;
      |             ^
main.c:5:17: error: array size missing in 't'
    5 |     int n,q,s[],t[],i,j;
      |                 ^
Language: C

#include <stdio.h>

int main()
{
    int n,q,s[],t[],i,j;
    int c = 0;

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

    scanf ("%d",&q);
    for (i=0; i<q; i++) {
      scanf ("%d",&t[i]);
    }

    for (i=0; i<n; i++) {
      for (j=0; j<q; j++) {
        if (t[i] == s[j]) {
        c++;
        }
      }
    }

    printf ("%d\n",c);

    return 0;
} 

Compiler output:
main.c: In function 'main':
main.c:5:13: error: array size missing in 's'
    5 |     int n,q,s[],t[],i,j;
      |             ^
main.c:5:17: error: array size missing in 't'
    5 |     int n,q,s[],t[],i,j;
      |                 ^
Language: C

#include <stdio.h>

int main()
{
    int n,q,s[],t[],i,j;
    int c = 0;

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

    scanf ("%d",&q);
    for (i=0; i<q; i++) {
      scanf ("%d",&t[i]);
    }

    for (i=0; i<q; i++) {
      for (j=0; j<n; j++) {
        if (t[i] == s[j]) {
        c++;
        }
      }
    }

    printf ("%d\n",c);

    return 0;
} 

Compiler output:
main.c: In function 'main':
main.c:5:13: error: array size missing in 's'
    5 |     int n,q,s[],t[],i,j;
      |             ^
main.c:5:17: error: array size missing in 't'
    5 |     int n,q,s[],t[],i,j;
      |                 ^
Language: C

#include <stdio.h>

int main()
{
    int n,q,s[],t[],i,j;
    int c = 0;

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

    scanf ("%d",&q);
    for (i = 0; i < q; i++) {
      scanf ("%d",&t[i]);
    }

    for (i = 0; i < q; i++) {
      for (j = 0; j < n; j++) {
        if (t[i] == s[j]) {
        c++;
        }
      }
    }

    printf ("%d\n",c);

    return 0;
} 

Compiler output:
main.c: In function 'main':
main.c:5:13: error: array size missing in 's'
    5 |     int n,q,s[],t[],i,j;
      |             ^
main.c:5:17: error: array size missing in 't'
    5 |     int n,q,s[],t[],i,j;
      |                 ^
Language: C

#include<stdio.h>
int main () {

   int  n, s[10000], q, t[500];
   int  i, key, count;

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

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

   count = 0;
   for (i = 0; i < n; i++) {
     s[i] = key;
     while (t[i] != key) {
       i++
       if (i == q-1) {
          break;
       }
     count++;
     }

   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:21:11: error: expected ';' before 'if'
   21 |        i++
      |           ^
      |           ;
   22 |        if (i == q-1) {
      |        ~~  
main.c:29:1: error: expected declaration or statement at end of input
   29 | }
      | ^
Language: C

#include <stdio.h>
  
int main()
{
   int n, S[10000], q, T[500], c, i, j;
   c = 0;
 
   scanf("%d", &n);
   for (i = 0; i < n; i++)
      scanf("%d", &S[i]);

   scanf("%d", &q);
   for (i = 0; i < q; i++) {
      scanf("%d", &T[i]);

      for (j = i + 1; j < q; q++) {
         if (

   for (i = 0; i < n; i++) {
      for (j = 0; j < n;j++) {
         if (S[i] == T[j])
            c++;
      }
   }
   
   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:4: error: expected expression before 'for'
   19 |    for (i = 0; i < n; i++) {
      |    ^~~
main.c:27:1: error: expected expression before '}' token
   27 | }
      | ^
main.c:27:1: error: expected declaration or statement at end of input
main.c:27:1: error: expected declaration or statement at end of input
Language: C

#include <stdio.h>

#define n 5

int main() {
    int includeNumber[10000] = { 0 };
	int searchNumber[500] = { 0 };
	int needIN, needSN;
	int count;
	int i, j;
	count = 0;
	
	scanf("%d", &needIN);
	for (i = 0; i < needIN) {
		scanf("%d", includeNumber[i]);
	}
	scanf("%d", &needSN);
	for (i = 0; i < needSN) {
		scanf("%d", searchNumber[i]);
	}

	for (i = 0; i < needSN; i++) {
		for (j = 0; j < needIN; j++) {
			if (includeNumber[i] == searchNumber[j]) {
				count++;
			}
		}
	}

	printf("%d", count);

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:31: error: expected ';' before ')' token
   14 |         for (i = 0; i < needIN) {
      |                               ^
      |                               ;
main.c:18:31: error: expected ';' before ')' token
   18 |         for (i = 0; i < needSN) {
      |                               ^
      |                               ;
Language: C

#include <stdio.h>

#define n 5

int main() {
    int includeNumber[10000] = { 0 };
	int searchNumber[500] = { 0 };
	int needIN, needSN;
	int count;
	int i, j;
	count = 0;
	
	scanf_s("%d", &needIN);
	for (i = 0; i < needIN; i++) {
		scanf_s("%d", &includeNumber[i]);
	}
	scanf_s("%d", &needSN);
	for (i = 0; i < needSN; i++) {
		scanf_s("%d", &searchNumber[i]);
	}

	for (i = 0; i < needIN; i++) {
		for (j = 0; j < needSN; j++) {
			if (includeNumber[i] == searchNumber[j]) {
				searchNumber[j] = -1;
				count++;
			}
		}
	}

	printf_s("%d\n", count);

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   13 |         scanf_s("%d", &needIN);
      |         ^~~~~~~
      |         scanf
main.c:31:9: error: implicit declaration of function 'printf_s'; did you mean 'printf'? [-Wimplicit-function-declaration]
   31 |         printf_s("%d\n", count);
      |         ^~~~~~~~
      |         printf
Language: C

#include <stdio.h>

int search(int A[],int n,int key){
 int i;
 int a = 0;

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

}


int main(){
 int i, n, q, S[100000], c = 0;
 
 scanf("%d\n",&n);
 for(i = 0;i < n;i++){
   scanf("%d",S[i]);
  }
 scanf("%d\n",&q);
 for(i = 0;i < q;i++){
   scanf("%d",&key);
   if(search(S, n, key) = 1)
      c++;
 }

 printf("%d\n",c);
 return 0;
}

Compiler output:
main.c: In function 'main':
main.c:25:16: error: 'key' undeclared (first use in this function)
   25 |    scanf("%d",&key);
      |                ^~~
main.c:25:16: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int search(int A[],int n,int key){
 int i;
 int a = 0;

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

}


int main(){
 int i, n, q, S[100000], c , key= 0;
 
 scanf("%d\n",&n);
 for(i = 0;i < n;i++){
   scanf("%d",S[i]);
  }
 scanf("%d\n",&q);
 for(i = 0;i < q;i++){
   scanf("%d",&key);
   if(search(S, n, key) = 1)
      c++;
 }

 printf("%d\n",c);
 return 0;
}

Compiler output:
main.c: In function 'main':
main.c:26:25: error: lvalue required as left operand of assignment
   26 |    if(search(S, n, key) = 1)
      |                         ^
Language: C

#include<stdio.h>

int search(int A[], int n,int key){
 int i = 0, int c = 0;
 A[n] = key;
 while ( A[i] != key )
       i++;
 
 if( A[i] != n ) 
    c = 1;

 return c;
}

int main(???{

 int i, n, A[1000+1], q, key, sum = 0;

 scanf("%d\n", &n);
 for( i = 0; i < n; i++){
   scanf("%d", &key);
   search(A, n, key);
   if(c=1)
     sum++;
 }
 printf("%d\n", sum);

 return 0;
}

Compiler output:
main.c: In function 'search':
main.c:4:13: error: expected identifier or '(' before 'int'
    4 |  int i = 0, int c = 0;
      |             ^~~
main.c:10:5: error: 'c' undeclared (first use in this function)
   10 |     c = 1;
      |     ^
main.c:10:5: note: each undeclared identifier is reported only once for each function it appears in
main.c: At top level:
main.c:15:10: error: expected declaration specifiers or '...' before '?' token
   15 | int main(???{
      |          ^
Language: C

#include<stdio.h>

int search(int A[], int n,int key){
 int i = 0, int c = 0;
 A[n] = key;
 while ( A[i] != key )
       i++;
 
 if( A[i] != n ) 
    c = 1;

 return c;
}

int main(){

 int i, n, A[1000+1], q, key, sum = 0;

 scanf("%d\n", &n);
 for( i = 0; i < n; i++){
   scanf("%d", &key);
   search(A, n, key);
   if(c=1)
     sum++;
 }
 printf("%d\n", sum);

 return 0;
}

Compiler output:
main.c: In function 'search':
main.c:4:13: error: expected identifier or '(' before 'int'
    4 |  int i = 0, int c = 0;
      |             ^~~
main.c:10:5: error: 'c' undeclared (first use in this function)
   10 |     c = 1;
      |     ^
main.c:10:5: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:23:7: error: 'c' undeclared (first use in this function)
   23 |    if(c=1)
      |       ^
Language: C

#include<stdio.h>

int search(int A[], int n,int key){
 int i = 0, int c = 0;
 A[n] = key;
 while ( A[i] != key )
       i++;
 
 if( A[i] != n ) 
    c = 1;

 return c;
}

int main(){

 int , c = 0, i, n, A[1000+1], q, key, sum = 0;

 scanf("%d\n", &n);
 for( i = 0; i < n; i++){
   scanf("%d", &key);
   search(A, n, key);
   if(c=1)
     sum++;
 }
 printf("%d\n", sum);

 return 0;
}

Compiler output:
main.c: In function 'search':
main.c:4:13: error: expected identifier or '(' before 'int'
    4 |  int i = 0, int c = 0;
      |             ^~~
main.c:10:5: error: 'c' undeclared (first use in this function)
   10 |     c = 1;
      |     ^
main.c:10:5: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:17:6: error: expected identifier or '(' before ',' token
   17 |  int , c = 0, i, n, A[1000+1], q, key, sum = 0;
      |      ^
main.c:19:17: error: 'n' undeclared (first use in this function)
   19 |  scanf("%d\n", &n);
      |                 ^
main.c:20:7: error: 'i' undeclared (first use in this function)
   20 |  for( i = 0; i < n; i++){
      |       ^
main.c:21:17: error: 'key' undeclared (first use in this function)
   21 |    scanf("%d", &key);
      |                 ^~~
main.c:22:11: error: 'A' undeclared (first use in this function)
   22 |    search(A, n, key);
      |           ^
main.c:23:7: error: 'c' undeclared (first use in this function)
   23 |    if(c=1)
      |       ^
main.c:24:6: error: 'sum' undeclared (first use in this function)
   24 |      sum++;
      |      ^~~
Language: C

#include<stdio.h>

int search(int A[], int n,int key){
 int i = 0, int c = 0;
 A[n] = key;
 while ( A[i] != key )
       i++;
 
 if( A[i] != n ) 
    c = 1;

 return c;
}

int main(){

 int c = 0, i, n, A[1000+1], q, key, sum = 0;

 scanf("%d\n", &n);
 for( i = 0; i < n; i++){
   scanf("%d", &key);
   search(A, n, key);
   if(c=1)
     sum++;
 }
 printf("%d\n", sum);

 return 0;
}

Compiler output:
main.c: In function 'search':
main.c:4:13: error: expected identifier or '(' before 'int'
    4 |  int i = 0, int c = 0;
      |             ^~~
main.c:10:5: error: 'c' undeclared (first use in this function)
   10 |     c = 1;
      |     ^
main.c:10:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
 
int main(void)
{
  int S[10000], T[1000], n, q, i, j, k, l, cou = 0;
   scanf("%d",&n);
   scanf("%d",&q)
 
  for(i = 0; i < n; i++){
  scanf("%d", &S[i]);
  }
  for(j = 0; j < q; j++){
  scanf("%d", &T[i]);
  } 
  for(k = 0; k < q; k++){
    for(l = 0; l < n; l++){
      if(S[l] == T[k]){
    cou++;
      }
    }
  }
 
  printf("%d\n",cou);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:18: error: expected ';' before 'for'
    7 |    scanf("%d",&q)
      |                  ^
      |                  ;
    8 | 
    9 |   for(i = 0; i < n; i++){
      |   ~~~
Language: C

#include<stdio.h>
 
int main(void)
{
  int S[10000], T[1000], n, q, i, j, k, l, cou = 0;
   scanf("%d",&n);
   scanf("%d",&q);
 
  for(i = 0; i < n; i++){
   scanf("%d", &S[i]);
  }
  for(j = 0; j < q; j++){
   scanf("%d", &T[j]);
  } 
  for(k = 0; k < q; k++){
   for(l = 0; l < n; l++){
    if(S[l] == T[k]){
     cou++;
    break
      }
    }
  }
 
  printf("%d\n",cou);
 return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:10: error: expected ';' before '}' token
   19 |     break
      |          ^
      |          ;
   20 |       }
      |       ~
Language: C

#include<stdio.h>
 
int main(void)
{
  int S[20000], T[10000], n, q, i, j, k, l, cou = 0;
   scanf("%d",&n);
   scanf("%d",&q);
 
  for(i = 0; i < n; i++){
   scanf("%d", &S[i]);
  }
  for(j = 0; j < q; j++){
   scanf("%d", &T[j]);
  } 
  for(k = 0;k < q; k++){
   for(l = 0;l < n; l++){
    if(S[l] == T[k]){
     cou++;
      }
    }
  }
 
  printf("%d\n",cou);
 return 0;
}}

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

#include <stdio.h>

int main() {
  int i, j, n, s[10000], q, t[500], count = 0;

  scanf ("%d", %n);
  for ( i = 0; i < n; i++ )
    scanf("%d", &s[i]);

  scanf ("%d", %q);
  for ( i = 0; i < q; i++ )
    scanf("%d", &t[i]);

  for ( i = 0; i < q; i++ ) {
    for ( j = 0; j < n; j++ ) {
      if ( q[i] == s[j] ) count++;
    }
  }

  printf("%d\n", count);

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:16: error: expected expression before '%' token
    6 |   scanf ("%d", %n);
      |                ^
main.c:10:16: error: expected expression before '%' token
   10 |   scanf ("%d", %q);
      |                ^
main.c:16:13: error: subscripted value is neither array nor pointer nor vector
   16 |       if ( q[i] == s[j] ) count++;
      |             ^
Language: C

#include <stdio.h>

int main() {
  int i, j, n, s[10000], q, t[500], count = 0;

  scanf ("%d", &n);
  for ( i = 0; i < n; i++ )
    scanf("%d", &s[i]);

  scanf ("%d", &q);
  for ( i = 0; i < q; i++ )
    scanf("%d", &t[i]);

  for ( i = 0; i < q; i++ ) {
    for ( j = 0; j < n; j++ ) {
      if ( q[i] == s[j] ) count++;
    }
  }

  printf("%d\n", count);

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:13: error: subscripted value is neither array nor pointer nor vector
   16 |       if ( q[i] == s[j] ) count++;
      |             ^
Language: C

#include <stdio.h>

int main () {
	
	int n, s[10000],t[500], i, j, q,;
	int count = 0 ;

	
	scanf ("%d",&n) ;
	for ( i = 0 ; i < n ; i ++ ) {
		scanf("%d", &s[i] ) ;
	}
	scanf ("%d",&q) ;
	for ( i = 0 ; i < q ; i ++ ) {
		scanf("%d", &t[i] ) ;
	}
	
	for ( j = 0 ; j < q ; j++) {
		for ( i = 0 ; i < n ; i++) {
			if ( s[i] == t[j] ) {
				count++ ;
				break;
			}
		}
	}
	
	printf("%d\n",count);
	
return 0;
}


 

Compiler output:
main.c: In function 'main':
main.c:5:41: error: expected identifier or '(' before ';' token
    5 |         int n, s[10000],t[500], i, j, q,;
      |                                         ^
Language: C

#include<stdio.h>

int main(void){
	int array[n];
	int array2[m];
	int key; 
	int i;
	
	scanf("%d",&n); scanf("%d",&array[n]);
	scanf("%d",&m); scanf("%d",&array2[m]);

	c=linearsearch();
	puts("%d", c);
	return 0 ;
}

int linearSearch( ){
	for(i=0;i<n-1;n++){
		for(j=0; j<m-1;j++){
	key=array2[j];
	if(array[i]==key);
	return i;
	}
       return NOT_FOUND ;
     }
}

Compiler output:
main.c: In function 'main':
main.c:4:19: error: 'n' undeclared (first use in this function)
    4 |         int array[n];
      |                   ^
main.c:4:19: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:20: error: 'm' undeclared (first use in this function)
    5 |         int array2[m];
      |                    ^
main.c:12:9: error: 'c' undeclared (first use in this function)
   12 |         c=linearsearch();
      |         ^
main.c:12:11: error: implicit declaration of function 'linearsearch' [-Wimplicit-function-declaration]
   12 |         c=linearsearch();
      |           ^~~~~~~~~~~~
main.c:13:9: error: too many arguments to function 'puts'
   13 |         puts("%d", c);
      |         ^~~~
In file included from main.c:1:
/usr/include/stdio.h:714:12: note: declared here
  714 | extern int puts (const char *__s);
      |            ^~~~
main.c: In function 'linearSearch':
main.c:18:13: error: 'i' undeclared (first use in this function)
   18 |         for(i=0;i<n-1;n++){
      |             ^
main.c:18:19: error: 'n' undeclared (first use in this function)
   18 |         for(i=0;i<n-1;n++){
      |                   ^
main.c:19:21: error: 'j' undeclared (first use in this function)
   19 |                 for(j=0; j<m-1;j++){
      |                     ^
main.c:19:28: error: 'm' undeclared (first use in this function)
   19 |                 for(j=0; j<m-1;j++){
      |                            ^
main.c:20:9: error: 'key' undeclared (first use in this function)
   20 |         key=array2[j];
      |         ^~~
main.c:20:13: error: 'array2' undeclared (first use in this function)
   20 |         key=array2[j];
      |             ^~~~~~
main.c:21:12: error: 'array' undeclared (first use in this function)
   21 |         if(array[i]==key);
      |            ^~~~~
main.c:24:15: error: 'NOT_FOUND' undeclared (first use in this function)
   24 |        return NOT_FOUND ;
      |               ^~~~~~~~~
Language: C

#include <stdio.h>


bool linerSearch(int A[], int n, int key){
  int i = 0;
  A[n] = key;
  while (A[i] != key) {
    i++;
  }
  return i != n;
}


int main(int argc, char const *argv[]) {
  int n;
  int A[10000+1];
  int q;
  int key;
  int sum= 0;

  scanf("%d", &n);
  for(int i = 0; i < n; i++)  scanf("%d", &A[i]);

  scanf("%d", &q);
  for(int i = 0; i < q; i++)  {
    scanf("%d", &key);
    if (linerSearch(A, n, key))  sum++;
  }
  printf("%d\n", sum);
  return 0;
}

Compiler output:
main.c:4:1: error: unknown type name 'bool'
    4 | bool linerSearch(int A[], int n, int key){
      | ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include <stdio.h>
  +++ |+#include <stdbool.h>
    2 |
Language: C

#include <stdio.h>
#define N 1000000000
int linearSearch();
int i,j,n,q,S[N],T[N],c=0;
int main(){
  scanf("%d",&n);
  for(i=0;i<n;i++) scanf("%d",&S[i]);
  scanf("%d",&q);
  for(i=0;i<q;i++) scanf("%d",&T[i]);
 printf("%d\n",linearSearch());
  return 0;
}

int linearSearch(){

  for(i=0;i<q;i++){
    for(j=0;j<n;j++){
      if(T[i]==S[j]) c++;
    }
  }
  return c;
}

Compiler output:
/tmp/cch1AAc7.o: in function `main':
main.c:(.text+0xbb): relocation truncated to fit: R_X86_64_PC32 against symbol `T' defined in .bss section in /tmp/cch1AAc7.o
/tmp/cch1AAc7.o: in function `linearSearch':
main.c:(.text+0x151): relocation truncated to fit: R_X86_64_PC32 against symbol `T' defined in .bss section in /tmp/cch1AAc7.o
main.c:(.text+0x178): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/cch1AAc7.o
main.c:(.text+0x181): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/cch1AAc7.o
main.c:(.text+0x1c9): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/cch1AAc7.o
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>
#define N 1000000000
int linearSearch();
int i,j,n,q,S[N],T[N],c=0;
int main(){
  scanf("%d",&n);
  for(i=0;i<n;i++) scanf("%d",&S[i]);
  scanf("%d",&q);
  for(i=0;i<q;i++) scanf("%d",&T[i]);
 printf("%d\n",linearSearch());
  return 0;
}

int linearSearch(){

  for(i=0;i<q;i++){
    for(j=0;j<n;j++){
      if(T[i]==S[j]) c++;
    }
  }
  return c;
}

Compiler output:
/tmp/ccnCmB09.o: in function `main':
main.c:(.text+0xbb): relocation truncated to fit: R_X86_64_PC32 against symbol `T' defined in .bss section in /tmp/ccnCmB09.o
/tmp/ccnCmB09.o: in function `linearSearch':
main.c:(.text+0x151): relocation truncated to fit: R_X86_64_PC32 against symbol `T' defined in .bss section in /tmp/ccnCmB09.o
main.c:(.text+0x178): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/ccnCmB09.o
main.c:(.text+0x181): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/ccnCmB09.o
main.c:(.text+0x1c9): relocation truncated to fit: R_X86_64_PC32 against symbol `c' defined in .bss section in /tmp/ccnCmB09.o
collect2: error: ld returned 1 exit status
Language: C

#include<stdio.h>

int linearSearch(int ,int*);

int q;

int main(){
  int n,i,j;
  int s[10000],t[500];
  int cnt=0;

  scanf("%d",&n);
  if(n<0 || n>10000)
    exit(1);
  for(i=0;i<n;i++){
    scanf("%d",&s[i]);
    if(s[i]<0 || s[i]>1000000000)
      exit(3)
  }
  scanf("%d",&q);
  if(q<0 || q>500)
    exit(2);
  for(i=0;i<q;i++){
    scanf("%d",&t[i]);
    if(t[i]<0 || t[i]>1000000000)
      exit(4);
  }

  for(i=0;i<n;i++){
    j=linearSearch(s[i],t);
    if(j!=0){
      cnt+=j;
    }
  }

  printf("%d\n",cnt);


  return 0;
}

int linearSearch(int s,int *t){
  int i,cnt=0;
  for(i=0;i<q;i++){
    if(t[i]==s)
      cnt++;
  }
  return cnt;
}

Compiler output:
main.c: In function 'main':
main.c:14:5: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
   14 |     exit(1);
      |     ^~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
    1 | #include<stdio.h>
  +++ |+#include <stdlib.h>
    2 | 
main.c:14:5: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
   14 |     exit(1);
      |     ^~~~
main.c:14:5: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c:18:7: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
   18 |       exit(3)
      |       ^~~~
main.c:18:7: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c:18:14: error: expected ';' before '}' token
   18 |       exit(3)
      |              ^
      |              ;
   19 |   }
      |   ~           
main.c:22:5: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
   22 |     exit(2);
      |     ^~~~
main.c:22:5: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c:26:7: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
   26 |       exit(4);
      |       ^~~~
main.c:26:7: note: include '<stdlib.h>' or provide a declaration of 'exit'
Language: C

#include<stdio.h>

main(){
int n,q;
int S[],T[];
int i,j,cnt=0;

scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&S[i]);
}
scanf("%d",&q);
for(j=0;j<q;j++){
scanf("%d",&T[j]);
}

for(j=0;j<q;j++){
for(i=0;i<n;i++){
if(T[j]==S[i])cnt++;
}
}

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

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:5:5: error: array size missing in 'S'
    5 | int S[],T[];
      |     ^
main.c:5:9: error: array size missing in 'T'
    5 | int S[],T[];
      |         ^
Language: C

#include <stdio.h>
#define N 100000
#define Q 500

int linearSearch(int);
int S[N];
int n;

int main(){
  int i, q, C = 0;
  int T[Q];
  
  scanf("%d", &n);
  for( i=0 ; i<n ; i++ ){
    scanf("%d", &S[i]);
  }
  
  scanf("%d", &q);
  for( i=0 ; i<q ; i++ ){
    scanf("%d", &T[j]);
  }
  for( i=0 ; i<q ; i++ ){
    if( linearSearch(T[i])==1 )
      C++;
  }
  printf("%d\n", C);
  return 0;
}

int linearSearch(int key){
  int j = 0;
  S[n] = key;
  while(S[j]!=key)
    j++;
  if( j==n ) return 0;
  else return 1;
}

Compiler output:
main.c: In function 'main':
main.c:20:20: error: 'j' undeclared (first use in this function)
   20 |     scanf("%d", &T[j]);
      |                    ^
main.c:20:20: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#define N 100000
#define Q 500

int linearSearch(int);
int S[N];
int n;

int main(){
  int i, q, C = 0;
  int T[Q];
  
  scanf("%d", &n);
  for( i=0 ; i<n ; i++ ){
    scanf("%d", &S[i]);
  }
  
  scanf("%d", &q);
  for( i=0 ; i<q ; i++ ){
    scanf("%d", &T[ji);
  }
  for( i=0 ; i<q ; i++ ){
    if( linearSearch(T[i])==1 )
      C++;
  }
  printf("%d\n", C);
  return 0;
}

int linearSearch(int key){
  int j = 0;
  S[n] = key;
  while(S[j]!=key)
    j++;
  if( j==n ) return 0;
  else return 1;
}

Compiler output:
main.c: In function 'main':
main.c:20:20: error: 'ji' undeclared (first use in this function); did you mean 'i'?
   20 |     scanf("%d", &T[ji);
      |                    ^~
      |                    i
main.c:20:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:22: error: expected ']' before ')' token
   20 |     scanf("%d", &T[ji);
      |                      ^
      |                      ]
Language: C

#include<stdio.h>
#define N 10000
#define Q 500

main(){
int n,q;
int S[],T[];
int i,j,cnt=0;

scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&S[i]);
}
scanf("%d",&q);
for(j=0;j<q;j++){
scanf("%d",&T[j]);
}

for(j=0;j<q;j++){
for(i=0;i<n;i++){
if(T[j]==S[i])cnt++;
}
}

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

Compiler output:
main.c:5:1: error: return type defaults to 'int' [-Wimplicit-int]
    5 | main(){
      | ^~~~
main.c: In function 'main':
main.c:7:5: error: array size missing in 'S'
    7 | int S[],T[];
      |     ^
main.c:7:9: error: array size missing in 'T'
    7 | int S[],T[];
      |         ^
Language: C

#include<stdio.h>

main(){
int n<=10000,q<=500;
int S[n],T[q];
int i,j,cnt=0;

scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&S[i]);
}
scanf("%d",&q);
for(j=0;j<q;j++){
scanf("%d",&T[j]);
}

for(j=0;j<q;j++){
for(i=0;i<n;i++){
if(T[j]==S[i])cnt++;
}
}

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

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:4:6: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
    4 | int n<=10000,q<=500;
      |      ^~
main.c:4:6: error: expected expression before '<=' token
main.c:5:7: error: 'n' undeclared (first use in this function)
    5 | int S[n],T[q];
      |       ^
main.c:5:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:12: error: 'q' undeclared (first use in this function)
    5 | int S[n],T[q];
      |            ^
Language: C

int A[100];

int main(){
  int q, i, cnt=0;
  int B[100];

  scanf("%d",&n);
  for(i=0; i<n ; i++) scanf("%d",&A[i]);

  scanf("%d",&q);
  for(i=0; i<q ; i++) scanf("%d",&B[i]);

  for(i=0 ; i<q ; i++){
    cnt += linearSearch(B[i]);
  }

  printf("%d\n",cnt);
  return 0;
}

int linearSearch(int key){
  int i;

  i = 0;
  A[n] = key;
  
  while(A[i] != key) i++;

  if(i==n) return 0;

  return 1;
}

Compiler output:
main.c: In function 'main':
main.c:7:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    7 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int A[100];
main.c:7:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    7 |   scanf("%d",&n);
      |   ^~~~~
main.c:7:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:7:15: error: 'n' undeclared (first use in this function)
    7 |   scanf("%d",&n);
      |               ^
main.c:7:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:12: error: implicit declaration of function 'linearSearch' [-Wimplicit-function-declaration]
   14 |     cnt += linearSearch(B[i]);
      |            ^~~~~~~~~~~~
main.c:17:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   17 |   printf("%d\n",cnt);
      |   ^~~~~~
main.c:17:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:17:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:17:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: In function 'linearSearch':
main.c:25:5: error: 'n' undeclared (first use in this function)
   25 |   A[n] = key;
      |     ^
Language: C

#include<stdio.h>

int N=10000;
int S[N];
int Q=500;
int n;

main(){
int q;
int T[Q];
int i,j,cnt=0;

scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&S[i]);
}
scanf("%d",&q);
for(j=0;j<q;j++){
scanf("%d",&T[j]);
}

for(j=0;j<q;j++){
for(i=0;i<n;i++){
if(T[j]==S[i])cnt++;
}
}

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

Compiler output:
main.c:4:5: error: variably modified 'S' at file scope
    4 | int S[N];
      |     ^
main.c:8:1: error: return type defaults to 'int' [-Wimplicit-int]
    8 | main(){
      | ^~~~
Language: C

#include <stdio.h>
#define N 1000
#define Q 500
int linearSearch(int*, int);
int n;
int main()
{
  int q;
  int s[N],t[Q];
  int i;
  int c=0,cnt=0;

  scanf("%d",&n);
  for(i=0; i<n; i++){
    scanf("%d",&s[i]);
  }
  
  scanf("%d",&q);
  for(i=0; i<q; i++){
    scanf("%d",&t[i]);
    c = linearSearch(s,t[i]);
    if(c==1) cnt++;
  }

  printf("%d\n",cnt);

  return 0;

}

int linearSearch(int *x,int key)
{
  int i;
  for(i=0; i<n; i++){
    if(x[i]==key) return 1;
  }
  
  return 0;

Compiler output:
main.c: In function 'linearSearch':
main.c:38:3: error: expected declaration or statement at end of input
   38 |   return 0;
      |   ^~~~~~
Language: C

#include <stdio.h>
#define N 10000
#define Q 500

int linersearch(int *,int,int);

int main() {
  int i,n,q,S[N],T[Q],cnt=0;

  scanf("%d",%n);
  for (i = 0; i < n; i++) {
    scanf("%d",S[n]);
  }
  scanf("%d",%q);
  for (i = 0; i < q; i++) {
    scanf("%d",T[q]);
  }

  for (i = 0; i < q; i++) {
    judge = linersearch(S,n,T[i]);
    if(judge == 1)cnt++;
  }

  printf("%d\n",cnt);
  return 0;
}
int linersearch(int *array,int n,int key){
  int i;
  
  for (i = 0; i < n; i++) {
    if (array[i] = key) return 1;
  }

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:14: error: expected expression before '%' token
   10 |   scanf("%d",%n);
      |              ^
main.c:14:14: error: expected expression before '%' token
   14 |   scanf("%d",%q);
      |              ^
main.c:20:5: error: 'judge' undeclared (first use in this function)
   20 |     judge = linersearch(S,n,T[i]);
      |     ^~~~~
main.c:20:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#define N 10000

int main(){
  int i,j,count,n,q,S[Max],T[Max];
 
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&S[i]);
  }
  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%d",&T[i]);
  }

  count=0;

   for(i=0;i<q;i++){
      S[n]=T[i];
      for(j=0;j<=n;j++){
      if(j==n) break;
      else if(S[j]==T[i]){
        count++;
        break;
      }
    }
    }
  printf("%d\n",h);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:23: error: 'Max' undeclared (first use in this function)
    5 |   int i,j,count,n,q,S[Max],T[Max];
      |                       ^~~
main.c:5:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:28:17: error: 'h' undeclared (first use in this function)
   28 |   printf("%d\n",h);
      |                 ^
Language: C

#include<stdio.h>
#define N 10000

int search(int *, int, int);

int main()
{ 
 int i, n, A[N], q, key, count=0;
 
  scanf("%d", &n);
  for(i=0;i<n;i++){
    scanf("%d", &A[i]);
  }
  scanf("%d", &q);
  for(i=0;i<q;i++){
    scanf("%d", &key);
    if(search(A, n, key)){
      sum++;
    }
  }
  printf("%d\n", sum);

  return 0;
}
int search(int A[], int n, int key){
  int i;
  for (i=0;i<n;i++){
    if (A[i]==key) return 1;
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:18:7: error: 'sum' undeclared (first use in this function)
   18 |       sum++;
      |       ^~~
main.c:18:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#define N 10000

int search(int *, int, int);

int main()
{ 
 int i, n, A[N], q, key, count=0;
 
  scanf("%d", &n);
  for(i=0;i<n;i++){
    scanf("%d", &A[i]);
  }
  scanf("%d", &q);
  for(i=0;i<q;i++){
    scanf("%d", &key);
    if(search(A, n, key)){
      sum++;
    }
  }
  printf("%d\n", count);

  return 0;
}
int search(int A[], int n, int key){
  int i;
  for (i=0;i<n;i++){
    if (A[i]==key) return 1;
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:18:7: error: 'sum' undeclared (first use in this function)
   18 |       sum++;
      |       ^~~
main.c:18:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
int linearsearch(int A[],int n,int key){
  int i=0;
  A[n]=key;
  while(A[i]!=key){
    i++;
    if(i==n){
      return 0;
    }
  return i;
}
int main(){
  int i,n,A[10001],q,key,sum=0;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }
  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%d",&key);
    sum=linearsearch(A,n,key);
  }
  printf("%d\n",sum);
  return 0;
}

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

#include <stdio.h>
int LinearSearch(int A[],int n,int key){
  int i=0;
  A[n]=key;
  while(A[i]!=key){
    i++;
    if(i==n){
      return 0;
    }
  return i;
}
int main(){
  int i,n,A[10001],q,key,sum=0;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }
  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%d",&key);
    sum=LinearSearch(A,n,key);
  }
  printf("%d\n",sum);
  return 0;
}

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

#include<stdio.h>

int main(){
  int sn,tn,count=0,i,j;
     int s[10000];
     int t[500];
  scanf("%d",&sn);
  for(i=0;i<sn;i++){
    scanf("%d",&s[i]);
  }
  scanf("%d",&tn);
  for(i=0;i<tn;i++){
    scanf("%d",&t[i]);
  }
  for(i=0;i<sn;i++){
    for(j=0;j<tn;j++){
      if(s[i]==t[j]){
count++;
break;
    }
  }
  printf("%d\n",count);
}

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

int Lsearch(int B,int kkey){

  if(B==kkey) return 1;
  else return 0;
}


int main(){
  int x,y,i,key,res;

  scanf("%d",&x);
  for(i=0;i<x;i++){
    scanf("%d",A[i]);
  }
   scanf("%d",&y);
  for(i=0;i<y;i++){
    scanf("%d",key);
    if(Lsearch(A[i],key)==1){
      res++;
    }

    printf("%d\n",res);
    return 0;
  }
}

Compiler output:
main.c: In function 'main':
main.c:11:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   11 |   scanf("%d",&x);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int Lsearch(int B,int kkey){
main.c:11:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   11 |   scanf("%d",&x);
      |   ^~~~~
main.c:11:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:13:16: error: 'A' undeclared (first use in this function)
   13 |     scanf("%d",A[i]);
      |                ^
main.c:13:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:22:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   22 |     printf("%d\n",res);
      |     ^~~~~~
main.c:22:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:22:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:22:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include <stdio.h>
int linearSearch(int *,int,int);

int main()
{
  int i,n,A[10000],q,key,num;

  scanf("%d",&n);

  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }

  scanf("%d",&q);

  for(i=0;i<q;i++){
    scanf("%d",&key);
    if(linearSearch(A,n,key)) num++;
  }

  printf("%d\n",num);

  return 0;
}

int linearSearch(int *A,int n,int key)
{
  int i=0;
  A[n]=key;
  while(A[i]!=key){
    i++;
  }
  if(i==n) return NOT_FOUND;
  else return i;
}

Compiler output:
main.c: In function 'linearSearch':
main.c:33:19: error: 'NOT_FOUND' undeclared (first use in this function)
   33 |   if(i==n) return NOT_FOUND;
      |                   ^~~~~~~~~
main.c:33:19: note: each undeclared identifier is reported only once for each function it appears in
Language: C


  scanf("%d",&q);
  for(j=0;j<q;j++){
    scanf("%d",&T[j]);
  }

  for(i=0;i<n;i++){
    for(j=0;j<q;j++){
      if(S[i]==T[j])sum++;
    }
  }
  printf("%d\n",sum);

  return 0;
}
  
  

Compiler output:
main.c:2:9: error: expected declaration specifiers or '...' before string constant
    2 |   scanf("%d",&q);
      |         ^~~~
main.c:2:14: error: expected declaration specifiers or '...' before '&' token
    2 |   scanf("%d",&q);
      |              ^
main.c:3:3: error: expected identifier or '(' before 'for'
    3 |   for(j=0;j<q;j++){
      |   ^~~
main.c:3:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    3 |   for(j=0;j<q;j++){
      |            ^
main.c:3:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    3 |   for(j=0;j<q;j++){
      |                ^~
main.c:7:3: error: expected identifier or '(' before 'for'
    7 |   for(i=0;i<n;i++){
      |   ^~~
main.c:7:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    7 |   for(i=0;i<n;i++){
      |            ^
main.c:7:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    7 |   for(i=0;i<n;i++){
      |                ^~
main.c:12:10: error: expected declaration specifiers or '...' before string constant
   12 |   printf("%d\n",sum);
      |          ^~~~~~
main.c:12:17: error: unknown type name 'sum'
   12 |   printf("%d\n",sum);
      |                 ^~~
main.c:14:3: error: expected identifier or '(' before 'return'
   14 |   return 0;
      |   ^~~~~~
main.c:15:1: error: expected identifier or '(' before '}' token
   15 | }
      | ^
Language: C

#include <stdio.h>
#define MAX 10000

int main(){
  int n, S[MAX], q, T[MAX], i, j, c = 0;

  scanf("%d", &n);
  for(i = 0; i < n; i++) scanf("%d", &S[i]);
  scanf("%d", &q);
  for(i = 0; i < q; i++) scanf("%d", &T[i]);

  for(i = 0; i < n; i++){
    for(j = 0; j < q; j++){
      if(S[i] == T[j]){
	c++;
	???//break;
      }
    }
  }
   
  printf("%d\n", c);

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:10: warning: trigraph ??/ ignored, use -trigraphs to enable [-Wtrigraphs]
   16 |         ???//break;
main.c:16:9: error: expected expression before '?' token
   16 |         ???//break;
      |         ^
Language: C

#include <stdio.h>
#define MAX 10000

int main(){
  int n, S[MAX], q, T[MAX], i, j, c = 0;

  scanf("%d", &n);
  for(i = 0; i < n; i++) scanf("%d", &S[i]);
  scanf("%d", &q);
  for(i = 0; i < q; i++) scanf("%d", &T[i]);

  for(i = 0; i < n; i++){
    for(j = 0; j < q; j++){
      if(S[i] == T[j]){
	c++;
	???
      }
    }
  }
   
  printf("%d\n", c);

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:9: error: expected expression before '?' token
   16 |         ???
      |         ^
Language: C

#include<stdio.h>

int linerSearch(int A[], int n, int key){
  int i=0;
  A[n]=key;
  while(A[i]!=key) i++;
  return i !=n;
}

int main(){
  int i=0, n, A[10000+1], q, key, sum=0;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }
  scanf("%d",q);
  for(i=0;i<q;i++){
    scanf("%d",&key);
    if(linerSearch(A,n,key))
      sum++;#include<stdio.h>

int linerSearch(int A[], int n, int key){
  int i=0;
  A[n]=key;
  while(A[i]!=key) i++;
  return i !=n;
}

int main(){
  int i=0, n, A[10000+1], q, key, sum=0;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }
  scanf("%d",q);
  for(i=0;i<q;i++){
    scanf("%d",&key);
    if(linerSearch(A,n,key))
      sum++;
  }
  printf("%d\n",sum);
  return 0;
}

  }
  printf("%d\n",sum);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:13: error: stray '#' in program
   20 |       sum++;#include<stdio.h>
      |             ^
main.c:20:14: error: 'include' undeclared (first use in this function)
   20 |       sum++;#include<stdio.h>
      |              ^~~~~~~
main.c:20:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:22: error: 'stdio' undeclared (first use in this function); did you mean 'stdin'?
   20 |       sum++;#include<stdio.h>
      |                      ^~~~~
      |                      stdin
main.c:22:1: error: expected expression before 'int'
   22 | int linerSearch(int A[], int n, int key){
      | ^~~
Language: C

#include <stdio.h>
#define N 10000
#define M 500

int ls(int,int,int);

int main(){
  int n,q,key;
  int s[N];
  int count=0;
  
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&s[i]);
  }
  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%d",&key);
    if(ls(s,n,key)>0) count++;
  }
  printf("%d\n",count);
  return 0;
}

int ls(int s[],int n,int key){
  int i=0;
  s[n]=key;
  while(s[i]!=key){
    i++;
    if(i==n) return 0;
  }
  return i;
}

Compiler output:
main.c: In function 'main':
main.c:13:7: error: 'i' undeclared (first use in this function)
   13 |   for(i=0;i<n;i++){
      |       ^
main.c:13:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:19:11: error: passing argument 1 of 'ls' makes integer from pointer without a cast [-Wint-conversion]
   19 |     if(ls(s,n,key)>0) count++;
      |           ^
      |           |
      |           int *
main.c:5:8: note: expected 'int' but argument is of type 'int *'
    5 | int ls(int,int,int);
      |        ^~~
main.c: At top level:
main.c:25:5: error: conflicting types for 'ls'; have 'int(int *, int,  int)'
   25 | int ls(int s[],int n,int key){
      |     ^~
main.c:5:5: note: previous declaration of 'ls' with type 'int(int,  int,  int)'
    5 | int ls(int,int,int);
      |     ^~
Language: C

#include <stdio.h>

int main(){
  int x,y,i,j,k=0,key,res=0,A[10000+1];

  scanf("%d",&x);
  for(i=0;i<x;i++){
    scanf("%d",&A[i]);
  }
   scanf("%d",&y);
  for(i=0;i<y;i++){
    scanf("%d",&key);
    for(j=0;j<x;j++){
    if(Lsearch(A[j],key)==1){
      if(j==0)same[k]=key;
      if(same[k]!=key)
      res++;
      same[k]=key;
      k++
     }
    }
  }

    printf("%d\n",res);
    return 0;
  }

int Lsearch(int B,int kkey){

  if(B==kkey) return 1;
  else return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:8: error: implicit declaration of function 'Lsearch' [-Wimplicit-function-declaration]
   14 |     if(Lsearch(A[j],key)==1){
      |        ^~~~~~~
main.c:15:15: error: 'same' undeclared (first use in this function)
   15 |       if(j==0)same[k]=key;
      |               ^~~~
main.c:15:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:19:10: error: expected ';' before '}' token
   19 |       k++
      |          ^
      |          ;
   20 |      }
      |      ~
Language: C

#include<stdio.h>
#include<stdlib.h>

int linearSearch(int * ,int, int);

int main(){

  int i,count=0;
  int insertNumber1,insertNumber2,*S,*T;

  scanf("%d",&insertNumber1);
  S=(int *) malloc(sizeof(int)*insertNumber1);
  for(i=0;i<insertNumber1;i++) scanf("%d",&S[i]);
  scanf("%d",&insertNumber2);
  T= (int *) malloc(sizeof(int)*insertNumber2);
  for(i=0;i<insertNumber2;i++) {
    scanf("%d",&T[i]);
  }

  for(i=0;i<q;i++) {
    count+=linearSearch(S,T[i],insertNumber1);
  }

  printf("%d\n",count);

  return 0;
}
int linearSearch(int *S,int key,int insertNumber){

  int i=0;
  A[insertNumber]=key;
  while(S[i]!=key){
    i++;
    if(i==insertNumber) return 0;
  }

  return 1;
}

Compiler output:
main.c: In function 'main':
main.c:20:13: error: 'q' undeclared (first use in this function)
   20 |   for(i=0;i<q;i++) {
      |             ^
main.c:20:13: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'linearSearch':
main.c:31:3: error: 'A' undeclared (first use in this function)
   31 |   A[insertNumber]=key;
      |   ^