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

#include<stdio.h>
#define S 10000
#define T 500

main(){

  int n[S],q[T],count=0,a,b,i,j;

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

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

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

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

Compiler output:
main.c:5:1: error: return type defaults to 'int' [-Wimplicit-int]
    5 | main(){
      | ^~~~
main.c: In function 'main':
main.c:20:16: error: expected ';' before 'break'
   20 |         count++
      |                ^
      |                ;
   21 |           break;
      |           ~~~~~
Language: C

#include <stdio.h>

int main(){
  int i, j, k, n, q, S[100000], T[100000];
  k = 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]){
	k++;
	break;
    }
  }

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

  return 0;
}

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

#include<stdio.h>

int S[10000000000];
int T[10000000000];

int count=0;
int Scount;
int Tcount;
int linearSearch(void);

int main(){

  scanf("%d",&Scount);
  while(count < Scount){
    scanf("%d",&S[count]);
    // printf("%d ",S[count]);
    count++;
  }
  //printf("\n");
  count = 0;

  scanf("%d",&Tcount);
  while(count < Tcount){
    scanf("%d",&T[count]);
    // printf("%d ",T[count]);
    count++;
  }
  //printf("\n");

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

int linearSearch(){
  int i = 0;
  int j = 0;
  int same = 0;
  while(i < Scount){
    // printf("%d\n",count);
    T[count] = S[i];  
    j = 0;
    //  printf("%d\n",T[count]);

    while(T[j] != S[i]){
      j++;
    }
    if(j != count) same++;
    i++;
  } 
  return same;
}
      
      

Compiler output:
/tmp/ccftiuGA.o: in function `main':
main.c:(.text+0x7): relocation truncated to fit: R_X86_64_PC32 against symbol `Scount' defined in .bss section in /tmp/ccftiuGA.o
main.c:(.text+0x26): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccftiuGA.o
main.c:(.text+0x57): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccftiuGA.o
main.c:(.text+0x60): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccftiuGA.o
main.c:(.text+0x66): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccftiuGA.o
main.c:(.text+0x6c): relocation truncated to fit: R_X86_64_PC32 against symbol `Scount' defined in .bss section in /tmp/ccftiuGA.o
main.c:(.text+0x76): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccftiuGA.o
main.c:(.text+0x81): relocation truncated to fit: R_X86_64_PC32 against symbol `Tcount' defined in .bss section in /tmp/ccftiuGA.o
main.c:(.text+0xa0): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccftiuGA.o
main.c:(.text+0xb1): relocation truncated to fit: R_X86_64_PC32 against symbol `T' defined in .bss section in /tmp/ccftiuGA.o
main.c:(.text+0xd1): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C

#include<stdio.h>

int main(){

  int S[1000000];
  int T[1000000];
  int Scount;
  int Tcount;
  int count;
  int i,j;

  scanf("%d",&Scount);

  for(count = 0;count < Scount;count++){
    scanf("%d",&S[count]);
  }

  scanf("%d",&Tcount);

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

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

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

	x++;
      }
      if(j != a){
	c++;
      }
    }
    
    printf("%d\n",c);
    return 0;
}

Compiler output:
main.c:1:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    1 |         x++;
      |          ^~
main.c:2:7: error: expected identifier or '(' before '}' token
    2 |       }
      |       ^
main.c:3:7: error: expected identifier or '(' before 'if'
    3 |       if(j != a){
      |       ^~
main.c:6:5: error: expected identifier or '(' before '}' token
    6 |     }
      |     ^
main.c:8:12: error: expected declaration specifiers or '...' before string constant
    8 |     printf("%d\n",c);
      |            ^~~~~~
main.c:8:19: error: unknown type name 'c'
    8 |     printf("%d\n",c);
      |                   ^
main.c:9:5: error: expected identifier or '(' before 'return'
    9 |     return 0;
      |     ^~~~~~
main.c:10:1: error: expected identifier or '(' before '}' token
   10 | }
      | ^
Language: C

 int n, m, i, l;
  int S[N], T[q];
  int count = 0;
  
  scanf("%d",&n);
  scanf("%d",&m);
  
  for(l = 0; l < n; l++) {
    scanf("%d",&S[l]);
  }
  
  for(i = 0; i < m; i++) {
    scanf("%d",&T[i]);
  }
  
  for(i = 0; i < m; i++) {
    for(l = 0; l < n; l++) {
      if(T[i] == S[l]) {
	count++;
      }
    }
  }
  printf("%d\n",count);
  return 0;
}

Compiler output:
main.c:2:9: error: 'N' undeclared here (not in a function)
    2 |   int S[N], T[q];
      |         ^
main.c:2:15: error: 'q' undeclared here (not in a function)
    2 |   int S[N], T[q];
      |               ^
main.c:5:9: error: expected declaration specifiers or '...' before string constant
    5 |   scanf("%d",&n);
      |         ^~~~
main.c:5:14: error: expected declaration specifiers or '...' before '&' token
    5 |   scanf("%d",&n);
      |              ^
main.c:6:9: error: expected declaration specifiers or '...' before string constant
    6 |   scanf("%d",&m);
      |         ^~~~
main.c:6:14: error: expected declaration specifiers or '...' before '&' token
    6 |   scanf("%d",&m);
      |              ^
main.c:8:3: error: expected identifier or '(' before 'for'
    8 |   for(l = 0; l < n; l++) {
      |   ^~~
main.c:8:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    8 |   for(l = 0; l < n; l++) {
      |                ^
main.c:8:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    8 |   for(l = 0; l < n; l++) {
      |                      ^~
main.c:12:3: error: expected identifier or '(' before 'for'
   12 |   for(i = 0; i < m; i++) {
      |   ^~~
main.c:12:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   12 |   for(i = 0; i < m; i++) {
      |                ^
main.c:12:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   12 |   for(i = 0; i < m; i++) {
      |                      ^~
main.c:16:3: error: expected identifier or '(' before 'for'
   16 |   for(i = 0; i < m; i++) {
      |   ^~~
main.c:16:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   16 |   for(i = 0; i < m; i++) {
      |                ^
main.c:16:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   16 |   for(i = 0; i < m; i++) {
      |                      ^~
main.c:23:10: error: expected declaration specifiers or '...' before string constant
   23 |   printf("%d\n",count);
      |          ^~~~~~
main.c:23:17: error: expected declaration specifiers or '...' before 'count'
   23 |   printf("%d\n",count);
      |                 ^~~~~
main.c:24:3: error: expected identifier or '(' before 'return'
   24 |   return 0;
      |   ^~~~~~
main.c:25:1: error: expected identifier or '(' before '}' token
   25 | }
      | ^
Language: C

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

  for(i=0;i<m;i++){
    S[m-1]=T[i];
    j = 0;
    while(S[m-1]!=T[j]){
      j++;
      if(j==n-1){
        sum++;
        break;}
    }
  }

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

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C

 
int main(void){
  int i, j, n, q, S[N], T[M], count=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++){
    i=-1;
    S[n] = T[j];
    while(S[i] != T[j]){
       i++;
       // printf("%d\n", i);
      if(i == n) break;
       
      else if(S[i] == T[j]) {
    count++;
    //  printf("T[j]:%d\n", T[j]);
    break;
      }
      //   i++;
      }
  }   
  printf("%d\n", count);
  return 0; 
}

Compiler output:
main.c: In function 'main':
main.c:3:21: error: 'N' undeclared (first use in this function)
    3 |   int i, j, n, q, S[N], T[M], count=0;
      |                     ^
main.c:3:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:3:27: error: 'M' undeclared (first use in this function)
    3 |   int i, j, n, q, S[N], T[M], count=0;
      |                           ^
main.c:4:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |   scanf("%d", &n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | 
main.c:4:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |   scanf("%d", &n);
      |   ^~~~~
main.c:4:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:25:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   25 |   printf("%d\n", count);
      |   ^~~~~~
main.c:25:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:25:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:25:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include <stdio.h>
#define MAX 1000

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

Compiler output:
main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int]
    4 | main(){
      | ^~~~
main.c: In function 'main':
main.c:5:17: error: 'max' undeclared (first use in this function)
    5 |   int i,j,n,q,f[max],s[max],count=0;
      |                 ^~~
main.c:5:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

int S[N],n,sum=0;
int linerSearch(int);
main(){
  int q,i,key;
  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);
    linerSearch(key);
  }
  printf("%d\n",sum);
  return 0;
}

void linerSearch(int key){
  int i;
  for(i=0;i<n;i++){
    if(S[i]==key) sum++;
  }
}

Compiler output:
main.c:8:1: error: return type defaults to 'int' [-Wimplicit-int]
    8 | main(){
      | ^~~~
main.c:21:6: error: conflicting types for 'linerSearch'; have 'void(int)'
   21 | void linerSearch(int key){
      |      ^~~~~~~~~~~
main.c:7:5: note: previous declaration of 'linerSearch' with type 'int(int)'
    7 | int linerSearch(int);
      |     ^~~~~~~~~~~
Language: C

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

int data_n[10002];
int data_q[502];
int mach_data[502];
int mach_num;


/**------------ SUB ROUTIONE -------------*/
/**------------ SUB ROUTIONE -------------*/
int main()
{
	int  n,q,i,k,dt;
	int *sch_p;
	char inp[96];
	char *tr_p;
	char *wk_p;
	/** INIT **/
	mach_num = 0;

	/** INPUT **/
	gets(inp);

	/***************/
	/*--- n     ---*/
	/***************/
	sscanf(inp,"%d",&n);

	gets(inp);
	tr_p = strtok( inp," ");
	for(i=0 ;; i++) {
		if (tr_p == NULL) {
			break;
		}
		sscanf(tr_p,"%d",&data_n[i]);
		tr_p = strtok( NULL," ");
	}
	/***************/
	/*--- q     ---*/
	/***************/
	gets(inp);
	sscanf(inp,"%d",&q);

	gets(inp);
	tr_p = strtok( inp," ");
	for(i=0 ;; i++) {
		if (tr_p == NULL) {
			break;
		}
		sscanf(tr_p,"%d",&data_q[i]);
		tr_p = strtok( NULL," ");
	}

	/*--- CALC ---*/
	for (i=0 ; i<q ; i++) {
		dt = data_q[i];
		sch_p = &(data_n[0]);
 		for (k=0 ; k<n ; k++,sch_p++) {
			if (dt == *sch_p) {
				mach_data[mach_num] = *sch_p;
				mach_num++;
				//break;
got END;
			}
		}
	}

END:	/*---- OUTPUT ----*/
	if (mach_num == 0) {
		printf("0\n");
	}
	else {
		for (i=0 ; i<mach_num ; i++) {
			if (i+1 == mach_num) {
				printf("%d\n",mach_data[i]);
			}
			else {
				printf("%d ",mach_data[i]);
			}
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:26:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   26 |         gets(inp);
      |         ^~~~
      |         fgets
main.c:67:1: error: unknown type name 'got'
   67 | got END;
      | ^~~
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 n, A[10000+1], q, key, 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(search(A, n, key)) sum++;
		
	}
	printf("%d\n", sum);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:54: error: expected ';' before 'scanf'
   15 |         for(int i = 0; i < n; i++) scanf("%d", &A[i])
      |                                                      ^
      |                                                      ;
   16 |         scanf("%d", &q);
      |         ~~~~~
Language: C

#include <stdio.h>
#include <stdlib.h>
int main()
{
  int n, q, i, j, count = 0;
  int *s, *t;

  scanf("%d", &n);
  s = (int *)malloc(n*sizeof(int));
  for(i=0; i<n; i++) {
    scanf("%d", &s[i]);
  }
  scanf("%d", &q);
  t = (int *)malloc(q*sizeof(int));
  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])
        count++;
      }
    }
  }
  return 0;
}

Compiler output:
main.c:26:3: error: expected identifier or '(' before 'return'
   26 |   return 0;
      |   ^~~~~~
main.c:27:1: error: expected identifier or '(' before '}' token
   27 | }
      | ^
Language: C

#include<stdio.h>
#define N 500

int a[N],n1,n2;

int searchNumber(int x){
  for(i=0;i<n2;i++){
    if( a[i] == x ) return a[i];
  }
  return -1;
}

int main(){

  int i,j;
  int b[500];
  scanf("%d",&n1);
  for(i=0;i<n1;i++){
    scanf("%d",&a[i]);
  }

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

  for(i=0;i<n2-1;i++){
    number = search(b[i]);
    if( number != -1 ) printf("%d ",number);
  }

  number = search(b[i]);
  if(number != -1 ) printf("%d\n",number);
  return 0;
}

Compiler output:
main.c: In function 'searchNumber':
main.c:7:7: error: 'i' undeclared (first use in this function)
    7 |   for(i=0;i<n2;i++){
      |       ^
main.c:7:7: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:22:15: error: expected expression before ')' token
   22 |   scanf("%d",&);
      |               ^
main.c:28:5: error: 'number' undeclared (first use in this function)
   28 |     number = search(b[i]);
      |     ^~~~~~
main.c:28:14: error: implicit declaration of function 'search' [-Wimplicit-function-declaration]
   28 |     number = search(b[i]);
      |              ^~~~~~
Language: C

#include<stdio.h>
#define N 500

int a[N],n1,n2;

int searchNumber(int x){
  int i;
  for(i=0;i<n2;i++){
    if( a[i] == x ) return a[i];
  }
  return -1;
}

int main(){

  int i,j;
  int b[500];
  scanf("%d",&n1);
  for(i=0;i<n1;i++){
    scanf("%d",&a[i]);
  }

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

  for(i=0;i<n2-1;i++){
    number = search(b[i]);
    if( number != -1 ) printf("%d ",number);
  }

  number = search(b[i]);
  if(number != -1 ) printf("%d\n",number);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:23:15: error: expected expression before ')' token
   23 |   scanf("%d",&);
      |               ^
main.c:29:5: error: 'number' undeclared (first use in this function)
   29 |     number = search(b[i]);
      |     ^~~~~~
main.c:29:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:29:14: error: implicit declaration of function 'search' [-Wimplicit-function-declaration]
   29 |     number = search(b[i]);
      |              ^~~~~~
Language: C

#include<stdio.h>
#define N 500

int a[N],n1,n2,number;

int searchNumber(int x){
  int i;
  for(i=0;i<n2;i++){
    if( a[i] == x ) return a[i];
  }
  return -1;
}

int main(){

  int i,j;
  int b[500];
  scanf("%d",&n1);
  for(i=0;i<n1;i++){
    scanf("%d",&a[i]);
  }

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

  for(i=0;i<n2-1;i++){
    number = search(b[i]);
    if( number != -1 ) printf("%d ",number);
  }

  number = search(b[i]);
  if(number != -1 ) printf("%d\n",number);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:29:14: error: implicit declaration of function 'search' [-Wimplicit-function-declaration]
   29 |     number = search(b[i]);
      |              ^~~~~~
Language: C

#include<stdio.h>
#define N 10000
int main(){
  int i,j,count = 0,count1 = 0,n,q,S[N],T[N];

  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[j] == count1)continue;
      if(S[i] == T[j]){
	count++;
	count1 = T[j];
    }
  }

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

  return 0;

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

#include <stdio.h>
#define n 10000
#define q 5000

int main(){
  
  int S[n];
  int T[q];
  int U[n];

  int sNum,tNum;

  int i,j,k;

  int c = 0;

  int flag = 0;

  scanf("%d",&sNum);

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

  scanf("%d",&tNum);

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



  for(i = 0; i < sNum; i++){
    for(j = 0; j < tNum; j++){
      if(S[i] == T[j]){
	for(k = 0; k < c; k++){
	  if(U[k] == S[i]){
	    flag = 1;
	    break;
	  }
	}
	if(flag == 0){
	  U[c] = S[i];
	  c++;
	}
      }
    }

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

    return 0;
  }

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

#define N 10000
#define Q 500

int linearSearch(int *A, int n, int v){
  int i=0;
  A[n] = v;
  while(A[i] != v){
    i++;
    if(i == q) return 0;
  }
  return 1;
}

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

  // input and allocation
  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]);

  // search
  for(i=0; i<n; i++) c += linearSearch(&T,q,S[i]);

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

  return 0;
}

Compiler output:
main.c: In function 'linearSearch':
main.c:9:13: error: 'q' undeclared (first use in this function)
    9 |     if(i == q) return 0;
      |             ^
main.c:9:13: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:20:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   20 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #define N 10000
main.c:20:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   20 |   scanf("%d",&n);
      |   ^~~~~
main.c:20:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:26:40: error: passing argument 1 of 'linearSearch' from incompatible pointer type [-Wincompatible-pointer-types]
   26 |   for(i=0; i<n; i++) c += linearSearch(&T,q,S[i]);
      |                                        ^~
      |                                        |
      |                                        int (*)[500]
main.c:4:23: note: expected 'int *' but argument is of type 'int (*)[500]'
    4 | int linearSearch(int *A, int n, int v){
      |                  ~~~~~^
main.c:29:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   29 |   printf("%d\n", c);
      |   ^~~~~~
main.c:29:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:29:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:29:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>

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

  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++){
    key=T[i];
    S[n]=key;
    for(j=0;j<n+1;j++){
      if(key==S[j]){
	if(S[n]==S[j])break;
	count++;
    }
  }

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

  return 0;
}

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


#include<stdio.h>

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

  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++){
    key=T[i];
    // S[n]=key;
    for(j=0;j<n;j++){
      if(key==S[j]){
	count++;
    }
  }

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

  return 0;
}

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

#include <stdio.h>
#define N 1000
#define Q 1000

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

int main(){
  int q, i, 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[i]);
  }

  for(i=0; i<q; i++){
    flag = linear;
    if(flag == 1){
      c++;
    }
  }
    
  printf("%d\n",c);

  return 0;
}

int linear(int key){
  int i=0;
  S[n]=key;

  while(S[i] != key){
    i++;
    if(i == n){
      return 0;
    }
  }
  return 1;
}

Compiler output:
main.c: In function 'main':
main.c:24:5: error: 'flag' undeclared (first use in this function)
   24 |     flag = linear;
      |     ^~~~
main.c:24:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

#define NN 100000
#define NQ 50000

int linearSearch(int ,int* ,int);

int main(){

  int n, S[NN], q, T[NQ];
  int i=0,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++) linearSearch(T[i], S, n)) count++;

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

int linearSearch(int key, int* A, int n)
{

int  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:19:44: error: expected ';' before ')' token
   19 |   for(i=0;i<q;i++) linearSearch(T[i], S, n)) count++;
      |                                            ^
      |                                            ;
main.c:19:44: error: expected statement before ')' token
Language: C

#include <stdio.h>
#define Max 10700
int check(int a[],int key,int num){

  int i;
  for(i = 0;i < num;i++){
    if(a[i] == key) return -1;
  }

  return 0;
}
int main (){
  int n,s,q,t,i,j,dat1[Max],dat2[Max],con=0,temp;
 
 
  scanf("%d",&n);
  for ( j = 0;j < n;j++){
    if(scanf("%d",&dat1[j])==EOF)break;
  }
  scanf("%d",&q);

  while(1){
    scanf("%d",&temp);
    if(check(data2,temp,i) != 0){
      q--;
      continue;
    }
    data2[i] = temp;
    i++;
  }
 
  for ( i = 0;i < n;i++){
    for ( j = 0;j < q;j++){
      if(dat2[i] == dat1[j]){
    con++;
      }
    }
}
 
  printf("%d\n",con);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:24:14: error: 'data2' undeclared (first use in this function); did you mean 'dat2'?
   24 |     if(check(data2,temp,i) != 0){
      |              ^~~~~
      |              dat2
main.c:24:14: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <stdlib.h>
#definr N 10000

int main()
{
  int i, j;
  int n, q;
  int nl[N], s;
  int count = 0;

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

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

  return 0;
}

Compiler output:
main.c:3:2: error: invalid preprocessing directive #definr; did you mean #define?
    3 | #definr N 10000
      |  ^~~~~~
      |  define
main.c: In function 'main':
main.c:9:10: error: 'N' undeclared (first use in this function)
    9 |   int nl[N], s;
      |          ^
main.c:9:10: note: each undeclared identifier is reported only once for each function it appears in
Language: C


#include<stdio.h>

int main(){

  int n,q;
  int i,j;
  int s[1000000],t[1000000,c=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(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:8:27: error: expected ']' before ',' token
    8 |   int s[1000000],t[1000000,c=0;
      |                           ^
      |                           ]
main.c:33:1: error: expected declaration or statement at end of input
   33 | }
      | ^
Language: C

#include <stdio.h>

#define N 10000
#define Q 500

int main(){

  int i, j;
  int s[N], t[Q];
  int n, 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(i = 0; i < n; i++){//S
    for(j = 0; j < q; j++){//T

      if(s[i] == t[j]){
	count++;
	break;
      }

    }
    }*/

  for(i = 0; i < q; i++){//T
    for(j = 0; j < n; j++){//S

      if(t[i] == s[j]){
	count++;
	break;
      }

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

  return 0;
}

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

#include<stdio.h>

int main(){
  int S[10000];
  int T[500];
  int n,q,i,j,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",&[i]);
    i++;
  }

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

      if(S[i]==T[j]){
	count++;
	break;
      }
    }
  }

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

Compiler output:
main.c: In function 'main':
main.c:15:17: error: expected expression before '[' token
   15 |     scanf("%d",&[i]);
      |                 ^
Language: C


#include<stdio.h>
#define S_MAX 10000
#define T_MAX 10000
#define n_MAX 10000
#define q_MAX 500

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

  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(S[i] == T[j]){
	C++;
      }
    }
  }

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

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

  int n,q,i=0,S[10000],T[10000];
  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]);
  }

  return 0;
}



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

  if(i==n) return NOT_FOUND;
  else return i;

Compiler output:
main.c:20:3: error: 'n' undeclared here (not in a function)
   20 | A[n]=key;
      |   ^
main.c:20:1: warning: data definition has no type or storage class
   20 | A[n]=key;
      | ^
main.c:20:1: error: type defaults to 'int' in declaration of 'A' [-Wimplicit-int]
main.c:20:6: error: 'key' undeclared here (not in a function)
   20 | A[n]=key;
      |      ^~~
main.c:21:1: error: expected identifier or '(' before 'while'
   21 | while(A[i]!=key){
      | ^~~~~
Language: C

#include<stdio.h>
#define Max 10000

int main()
{
  int i,j,h,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]);
 
  h=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]){
	    h++;
	    breke;
	  }
	}
    }
  printf("%d\n",h);
  return 0;
}

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

#include <stdio.h>
int main(){
  int i,j=0,c=0,n1,n2,retu1[],retu2[],arr;
  scanf("%d",&n1);
  for(i=0;i<n1;i++){
    scanf("%d",&retu1[i]);
  }
  scanf("%d",&n2);
  for(i=0;i<n2;i++){
    scanf("%d",&retu2[i]);
  }
  /*lin.S*/
  for(i=0;i<n1;i++){
    j=0;
    while(1){
      if(retu1[i]==retu2[j]){
	c++;
	break;
      }
      else if(j==n2-1)
	break;
      else j++;
    }
  }
  printf("%d\n",c);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:3:23: error: array size missing in 'retu1'
    3 |   int i,j=0,c=0,n1,n2,retu1[],retu2[],arr;
      |                       ^~~~~
main.c:3:31: error: array size missing in 'retu2'
    3 |   int i,j=0,c=0,n1,n2,retu1[],retu2[],arr;
      |                               ^~~~~
Language: C

#include<stdio.h>

#define N 10000

int main(){

  int input_m[N], serch_m[500], m, n, i, key, c=0;

  scanf("%d", &n);

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

  scanf("%d",&m);

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

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

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

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:8: error: 'j' undeclared (first use in this function)
   17 |   for( j = 0; j < m; j ++){
      |        ^
main.c:17:8: 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 input_m[N], serch_m[500], m, n, i, j, c=0;

  scanf("%d", &n);

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

  scanf("%d",&m);

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

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

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

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:10: error: 'serch' undeclared (first use in this function); did you mean 'serch_m'?
   19 |       if(serch[j] == input_m[i])c++;
      |          ^~~~~
      |          serch_m
main.c:19:10: 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 input_m[N], serch_m[500], m, n, i, j, c=0;

  scanf("%d", &n);

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

  scanf("%d",&m);

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

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

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

    return 0;
  }

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

#include<stdio.h>

int S[10000];
int N;

int linearSearch(int);

int main(){
  int q, T[500], i, 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]);
    c += linearSearch(T[i]);    
  }
  printf("%d\n",c);
  return 0;
}

int linearSearch(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 'linearSearch':
main.c:32:3: error: expected declaration or statement at end of input
   32 |   }
      |   ^
Language: C

<?php
$fline = trim(fgets(STDIN));
$fnum = trim(fgets(STDIN));
$farray = explode(' ',$fnum);
$sline = trim(fgets(STDIN));
$snum = trim(fgets(STDIN));
$sarray = explode(' ',$snum);
$scount = 0;

foreach ($sarray as $skey => $svalue) {
    foreach ($farray as $fkey => $fvalue) {
        if ($svalue == $fvalue) {
            $scount++;
            break;
        }
    }
}
echo $scount;
?>

Compiler output:
main.c:1:1: error: expected identifier or '(' before '<' token
    1 | <?php
      | ^
main.c:3:1: warning: data definition has no type or storage class
    3 | $fnum = trim(fgets(STDIN));
      | ^~~~~
main.c:3:1: error: type defaults to 'int' in declaration of '$fnum' [-Wimplicit-int]
main.c:3:9: error: implicit declaration of function 'trim' [-Wimplicit-function-declaration]
    3 | $fnum = trim(fgets(STDIN));
      |         ^~~~
main.c:3:14: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration]
    3 | $fnum = trim(fgets(STDIN));
      |              ^~~~~
main.c:3:20: error: 'STDIN' undeclared here (not in a function)
    3 | $fnum = trim(fgets(STDIN));
      |                    ^~~~~
main.c:4:1: warning: data definition has no type or storage class
    4 | $farray = explode(' ',$fnum);
      | ^~~~~~~
main.c:4:1: error: type defaults to 'int' in declaration of '$farray' [-Wimplicit-int]
main.c:4:11: error: implicit declaration of function 'explode' [-Wimplicit-function-declaration]
    4 | $farray = explode(' ',$fnum);
      |           ^~~~~~~
main.c:4:11: error: initializer element is not constant
main.c:5:1: warning: data definition has no type or storage class
    5 | $sline = trim(fgets(STDIN));
      | ^~~~~~
main.c:5:1: error: type defaults to 'int' in declaration of '$sline' [-Wimplicit-int]
main.c:6:1: warning: data definition has no type or storage class
    6 | $snum = trim(fgets(STDIN));
      | ^~~~~
main.c:6:1: error: type defaults to 'int' in declaration of '$snum' [-Wimplicit-int]
main.c:7:1: warning: data definition has no type or storage class
    7 | $sarray = explode(' ',$snum);
      | ^~~~~~~
main.c:7:1: error: type defaults to 'int' in declaration of '$sarray' [-Wimplicit-int]
main.c:7:11: error: initializer element is not constant
    7 | $sarray = explode(' ',$snum);
      |           ^~~~~~~
main.c:8:1: warning: data definition has no type or storage class
    8 | $scount = 0;
      | ^~~~~~~
main.c:8:1: error: type defaults to 'int' in declaration of '$scount' [-Wimplicit-int]
main.c:10:10: error: expected declaration specifiers or '...' before '$sarray'
   10 | foreach ($sarray as $skey => $svalue) {
      |          ^~~~~~~
main.c:18:1: error: unknown type name 'echo'
   18 | echo $scount;
      | ^~~~
main.c:19:1: error: expected identifier or '(' before '?' token
   19 | ?>
      | ^
Language: C

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

int Search(int,int);

int main(){
  int n,q,i,j,count=0;
  int S[N],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[i]);
    for(j=0 ; j<n ; j++){
      count += Search(S[i],T[j]);
break
    }
  }
  printf("%d\n",count);

  return 0;
}

  int Search(int S,int T){
    if(S==T) return 1;
    return 0;
  }

Compiler output:
main.c: In function 'main':
main.c:26:6: error: expected ';' before '}' token
   26 | break
      |      ^
      |      ;
   27 |     }
      |     ~
Language: C

include<stdio.h>
#define MAX 10000
#define M 500
#define NOT_FOUND -1

int Search(int *,int,int);

int main()
{
  int i,j,n,q,a,count;
  int A[MAX],B[M],X[MAX];

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

  for(j = 0;j < q;j++){
    a = Search(A,n,B[j]);
    if(a != NOT_FOUND) count++;
  }
  printf("%d\n",count);
  return 0;
}

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

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
main.c: In function 'main':
main.c:13:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   13 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | include<stdio.h>
main.c:13:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   13 |   scanf("%d",&n);
      |   ^~~~~
main.c:13:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:23:9: error: implicit declaration of function 'Search' [-Wimplicit-function-declaration]
   23 |     a = Search(A,n,B[j]);
      |         ^~~~~~
main.c:26:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   26 |   printf("%d\n",count);
      |   ^~~~~~
main.c:26:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:26:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:26:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

 linearSearch()
   i = 0
   A[n] = key
   while A[i] ??¨ key ?????°??????
     i++
   if i ??? n ????????????
     return NOT_FOUND
   return i

Compiler output:
main.c:1:2: error: return type defaults to 'int' [-Wimplicit-int]
    1 |  linearSearch()
      |  ^~~~~~~~~~~~
main.c: In function 'linearSearch':
main.c:2:4: error: expected declaration specifiers before 'i'
    2 |    i = 0
      |    ^
main.c:4:28: error: stray '\302' in program
    4 |    while A[i] ??<U+00A8> key ?????<U+00B0>??????
      |                                   ^~~~~~~~
Language: C

#include<stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:11:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   11 |         for(int i=0,i<3,i++){
      |                      ^
main.c:19:1: error: expected expression before 'return'
   19 | return 0 ;}
      | ^~~~~~
main.c:19:11: error: expected expression before '}' token
   19 | return 0 ;}
      |           ^
Language: C

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

int main(void)
{
	int s_length, q_length, i, z = 0, x, j;
	int *s, *q;
	scanf("%d", &s_length);
	s = (int *)malloc(sizeof(int) * s_length);//int型nメモリ分の確保
	
	for(i = 0;i < s_length;i++){//配列に値を代入
		scanf("%d", &s[i]);//i = s_lengthの配列
	}
	
	scanf("%d", &q_length);
	
	q = (int *)malloc(sizeof(int) * q_length);//int型pメモリ分の確保
	
	for(x = 0;x < q_length;x++){
		scanf("%d", &array[x]);1//x = q_lengthの配列
	}
		
	for(i = 0;i < q_length;i++){
		for(j = 0j < s_length;j++){
			if(q[i] == s[j]){
				z++;
				break;
			}
		}
		
	}
	
	printf("%d\n", z);
			
	return 0;
	
	
}

Compiler output:
main.c: In function 'main':
main.c:20:30: error: 'array' undeclared (first use in this function)
   20 |                 scanf("%d", &array[x]);1//x = q_lengthの配列
      |                              ^~~~~
main.c:20:30: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:41: error: expected ';' before '}' token
   20 |                 scanf("%d", &array[x]);1//x = q_lengthの配列
      |                                         ^
      |                                         ;
   21 |         }
      |         ~                                
main.c:24:28: error: invalid operands to binary < (have 'complex int' and 'int')
   24 |                 for(j = 0j < s_length;j++){
      |                            ^
main.c:24:42: error: expected ';' before ')' token
   24 |                 for(j = 0j < s_length;j++){
      |                                          ^
      |                                          ;
Language: C

#include<stdio.h>

int main(){
  int n,S[],q,T[],C,i,j,key;

  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(i=0;i<n;i++){
    key=S[i];
    for(j=0;j<q;j++){
      if(key==T[j]) C++;}
  }


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

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:9: error: array size missing in 'S'
    4 |   int n,S[],q,T[],C,i,j,key;
      |         ^
main.c:4:15: error: array size missing in 'T'
    4 |   int n,S[],q,T[],C,i,j,key;
      |               ^
Language: C

#include<stdio.h>

#define A 1000000000;
#define B 1000000000;

int main(){
  int n,S[A],q,T[B],C,i,j,key;

  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(i=0;i<n;i++){
    key=S[i];
    for(j=0;j<q;j++){
      if(key==T[j]) C++;}
  }


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

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:3:21: error: expected ']' before ';' token
    3 | #define A 1000000000;
      |                     ^
main.c:7:11: note: in expansion of macro 'A'
    7 |   int n,S[A],q,T[B],C,i,j,key;
      |           ^
main.c:7:19: error: expected statement before ']' token
    7 |   int n,S[A],q,T[B],C,i,j,key;
      |                   ^
main.c:7:20: error: expected expression before ',' token
    7 |   int n,S[A],q,T[B],C,i,j,key;
      |                    ^
main.c:7:21: error: 'C' undeclared (first use in this function)
    7 |   int n,S[A],q,T[B],C,i,j,key;
      |                     ^
main.c:7:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:23: error: 'i' undeclared (first use in this function)
    7 |   int n,S[A],q,T[B],C,i,j,key;
      |                       ^
main.c:7:25: error: 'j' undeclared (first use in this function)
    7 |   int n,S[A],q,T[B],C,i,j,key;
      |                         ^
main.c:7:27: error: 'key' undeclared (first use in this function)
    7 |   int n,S[A],q,T[B],C,i,j,key;
      |                           ^~~
main.c:12:17: error: 'S' undeclared (first use in this function)
   12 |     scanf("%d",&S[i]);
      |                 ^
main.c:15:15: error: 'q' undeclared (first use in this function)
   15 |   scanf("%d",&q);
      |               ^
main.c:18:17: error: 'T' undeclared (first use in this function)
   18 |     scanf("%d",&T[j]);
      |                 ^
Language: C

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

int main(){
	int i;
	int n;
	int q;
	int A[100], B[100];
	int j;
	int 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", &B[i]);
	}
	
	for (i = 0; i < q; i++){
		for (j = 0; j < n; j++){
			if (B[i] == A[j]) sum++;
		}
	}

	printf("%d", sum);
	return 0;


}

Compiler output:
main.c:2:10: fatal error: iostream: No such file or directory
    2 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C


#include <stdio.h>

#include <math.h>

int main(){
	int i;
	int n;
	int q;
	int A[100000], B[10000];
	int j;
	int 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", &B[i]);
	}
	
	for (i = 0; i < q; i++){
		for (j = 0; j < n; j++){
			if (B[i] == A[j]){
				sum++; break;
		}
	}

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


}

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

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt();
		int[] s = new int[n];
		for (int i = 0; i < n; i++)
			s[i] = stdIn.nextInt();
		
		int q = stdIn.nextInt();
		int[] t = new int[q];
		for (int i = 0; i < q; i++)
			t[i] = stdIn.nextInt();
		
		int c = linearSearch(s, t);
		System.out.println(c);
	}
	
	public static int linearSearch(int[] a, int[] b) {
		int count = 0;
		for (int i = 0; i < b.length; i++)
			for(int j = 0; j < a.length; j++)
				if (b[i] == a[j]) {
					count++;
					break;
				}
		
		return count;
	}
}

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.Scanner;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.Scanner;
      |            ^
main.c:3:1: error: unknown type name 'public'
    3 | public class Main {
      | ^~~~~~
main.c:3:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    3 | public class Main {
      |              ^~~~
Language: C

#include<stdio.h>
int main(void){
   int a[10],b[10];
   int i,j,num,key,found=0;
   scanf("%d",&num);
   printf("\n");
   for(i=0;i<num;i++){
   scanf("%d",&a[i]);}
   printf("\n");
   scanf("%d",&key);
   printf("\n");
   for(j=0;j=key;j++){
   scanf("%d",&b[j]);}
   for(i=0;i<num;i++){
   if(b[j]==a[i]){
   found=1;}}
if(found==1){
   printf("%d",i+1);}
else
   printf("0");
getch();
}

Compiler output:
main.c: In function 'main':
main.c:21:1: error: implicit declaration of function 'getch'; did you mean 'getc'? [-Wimplicit-function-declaration]
   21 | getch();
      | ^~~~~
      | getc
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:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
main.c: In function 'main':
main.c:11:2: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   11 |  scanf("%d", &n);
      |  ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | include <stdio.h>
main.c:11:2: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   11 |  scanf("%d", &n);
      |  ^~~~~
main.c:11:2: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:17:6: error: implicit declaration of function 'search' [-Wimplicit-function-declaration]
   17 |   if(search(A, n, key)) sum++;
      |      ^~~~~~
main.c:19:2: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   19 |  printf("%d\n", sum);
      |  ^~~~~~
main.c:19:2: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:19:2: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:19:2: note: include '<stdio.h>' or provide a declaration of 'printf'
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[q]) {
        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;
      |                 ^