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

#include <stdio.h>
#define N 10000

int main(){
int i,j,s,n1,t,n2,teto[N],teto2[N],count=0;
scanf("%d",&n1);
for(i=0;i<n1;i++){
scanf("%d",teto[i]);
}
scanf("%d",&n2);
for(i=0;i<n2;i++){
scanf("%d",teto2[i]);
}
for(i=0;i<n2;i++){
for(f=0;j<n1;j++){
if(teto2[i]==teto1[j]){
count++;
break;
}
}
}
printf("%d",count);


return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:5: error: 'f' undeclared (first use in this function)
   15 | for(f=0;j<n1;j++){
      |     ^
main.c:15:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:14: error: 'teto1' undeclared (first use in this function); did you mean 'teto2'?
   16 | if(teto2[i]==teto1[j]){
      |              ^~~~~
      |              teto2
Language: C

#include <stdio.h>
#define N 10000

int main(){
int i,j,s,n1,t,n2,teto[N],teto2[N],count=0;
scanf("%d",&n1);
for(i=0;i<n1;i++){
scanf("%d",teto[i]);
}
scanf("%d",&n2);
for(i=0;i<n2;i++){
scanf("%d",teto2[i]);
}
for(i=0;i<n2;i++){
for(j=0;j<n1;j++){
if(teto2[i]==teto1[j]){
count++;
break;
}
}
}
printf("%d",count);


return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:14: error: 'teto1' undeclared (first use in this function); did you mean 'teto2'?
   16 | if(teto2[i]==teto1[j]){
      |              ^~~~~
      |              teto2
main.c:16:14: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

main(){
	int n1;
	scanf(“%d”, &n1);
	int i, j, array1[n1];

	for( i = 0; i < n1; i++){
	    scanf(“%d”, array1[i]);
	}

	int n2;
	scanf(“%d”, &n2);
	int array2[n2];

	for( i = 0; i < n2; i++){
           scanf(“%d”, array2[i]);
	}

	for( i = 0; i < n2; i++){
	   for( j = 0; j < n1; j++){
	          if( array2[i] == array1[j]){
		       printf(“%d”, array2[i]);
       	   }
        }

	if( i == n2 && j == n1){
		printf(“%d”, 0);
	}

	return 0;
}

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:5:15: error: stray '\342' in program
    5 |         scanf(<U+201C>%d<U+201D>, &n1);
      |               ^~~~~~~~
main.c:5:16: error: expected expression before '%' token
    5 |         scanf(“%d”, &n1);
      |                ^
main.c:5:18: error: stray '\342' in program
    5 |         scanf(<U+201C>%d<U+201D>, &n1);
      |                         ^~~~~~~~
main.c:9:19: error: stray '\342' in program
    9 |             scanf(<U+201C>%d<U+201D>, array1[i]);
      |                   ^~~~~~~~
main.c:9:20: error: expected expression before '%' token
    9 |             scanf(“%d”, array1[i]);
      |                    ^
main.c:9:22: error: stray '\342' in program
    9 |             scanf(<U+201C>%d<U+201D>, array1[i]);
      |                             ^~~~~~~~
main.c:13:15: error: stray '\342' in program
   13 |         scanf(<U+201C>%d<U+201D>, &n2);
      |               ^~~~~~~~
main.c:13:16: error: expected expression before '%' token
   13 |         scanf(“%d”, &n2);
      |                ^
main.c:13:18: error: stray '\342' in program
   13 |         scanf(<U+201C>%d<U+201D>, &n2);
      |                         ^~~~~~~~
main.c:17:18: error: stray '\342' in program
   17 |            scanf(<U+201C>%d<U+201D>, array2[i]);
      |                  ^~~~~~~~
main.c:17:19: error: expected expression before '%' token
   17 |            scanf(“%d”, array2[i]);
      |                   ^
main.c:17:21: error: stray '\342' in program
   17 |            scanf(<U+201C>%d<U+201D>, array2[i]);
      |                            ^~~~~~~~
main.c:23:31: error: stray '\342' in program
   23 |                        printf(<U+201C>%d<U+201D>, array2[i]);
      |                               ^~~~~~~~
main.c:23:32: error: expected expression before '%' token
   23 |                        printf(“%d”, array2[i]);
      |                                ^
main.c:23:34: error: stray '\342' in program
   23 |                        printf(<U+201C>%d<U+201D>, array2[i]);
      |                                         ^~~~~~~~
main.c:28:24: error: stray '\342' in program
   28 |                 printf(<U+201C>%d<U+201D>, 0);
      |                        ^~~~~~~~
main.c:28:25: error: expected expression before '%' token
   28 |                 printf(“%d”, 0);
      |                         ^
main.c:28:27: error: stray '\342' in program
   28 |                 printf(<U+201C>%d<U+201D>, 0);
      |                                  ^~~~~~~~
main.c:32:1: error: expected declaration or statement at end of input
   32 | }
      | ^
Language: C

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

int main(){
  
  int s[n],t[q],c=0,countn,countq,i,j,flag=0;
  
  scanf("%d",&countn);
  for(i = 0; i < countn; i++){
    
    scanf("%d",&s[i]);
  }
  scanf("%d",&countq);
  for(i = 0; i < countq; i++){
    
    scanf("%d",&t[i]);
  }
  for(j = 0; j < countq; j++){

    for(i = 0; i < countn; i++){
      if(s[i] == t[j] && flag = 0) c++;
      flag = 1;
    }
  }
  
  
  printf("%d\n",c);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:22:31: error: lvalue required as left operand of assignment
   22 |       if(s[i] == t[j] && flag = 0) c++;
      |                               ^
Language: C

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

int main(){
  
  int s[n],t[q],c=0,countn,countq,i,j,flag=0;
  
  scanf("%d",&countn);
  for(i = 0; i < countn; i++){
    
    scanf("%d",&s[i]);
  }
  scanf("%d",&countq);
  for(i = 0; i < countq; i++){
    
    scanf("%d",&t[i]);
  }
  for(j = 0; j < countq; j++){

    for(i = 0; i < countn; i++){
      if(s[i] == t[j] && flag == 0){ 
	c++;
      flag = 1;
      }
    }
  }
  
  
  printf("%d\n",c);
  
  return 0;
}

  
  return 0;
}

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

#include <stdio.h>

int main(){

  int n,m,i,a[10000],b[10000],k,j;
  m=0;
  
  scanf("%d",&n);#include <stdio.h>

int main(){

  int n,m,i,a[10000],b[10000],k,j;
  m=0;
  
  scanf("%d",&n);

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


  for(j=0;j<k;j++){

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

      if(a[i]==b[j]){
	m++;
	break;
      }
    }
  }
  printf("%d\n",m);
  return 0;
}

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


  for(j=0;j<k;j++){

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

      if(a[i]==b[j]){
	m++;
	break;
      }
    }
  }
  printf("%d\n",m);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:18: error: stray '#' in program
    8 |   scanf("%d",&n);#include <stdio.h>
      |                  ^
main.c:8:19: error: 'include' undeclared (first use in this function)
    8 |   scanf("%d",&n);#include <stdio.h>
      |                   ^~~~~~~
main.c:8:19: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:28: error: 'stdio' undeclared (first use in this function); did you mean 'stdin'?
    8 |   scanf("%d",&n);#include <stdio.h>
      |                            ^~~~~
      |                            stdin
main.c:10:1: error: expected expression before 'int'
   10 | int main(){
      | ^~~
Language: C

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

int search();
int n,S[N],q,T[Q];

main(int){
  int i,j;

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

  //seach
  printf("%d\n", search());
  
  return 0;
}

int search(){
  int left,right,mid,key;
  int i;
 
 for(i=0 ; i<q ; i++){
   left=0;
   right=n;
   key=T[i];
   
   while(left<right){
     mid=(left + right)/2;
     
     if(key ==  S[mid])
       return mid;
     
     else if(key > S[mid])
       left = mid+1;
     
     else if(key < S[mid])
       right=mid;
   }
 }
}

Compiler output:
main.c:8:1: error: return type defaults to 'int' [-Wimplicit-int]
    8 | main(int){
      | ^~~~
Language: C

#include <stdio.h>

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

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

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:27:1: error: expected declaration or statement at end of input
   27 | }
      | ^
Language: C

#include <stdio.h>

main(){
  int S[1000000000],T[1000000000],i,n,q,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<q;i++){
    for(j=0;j<n;j++){
      if(S[j]==T[i]) {
	c++;
	break;
    }
  }

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

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:27:1: error: expected declaration or statement at end of input
   27 | }
      | ^
Language: C

#define Q 500

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(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]){
	count++;
	break;
      }
    }
  }
  printf("%d\n",count);
  return 0;
}

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:5:9: error: 'N' undeclared (first use in this function)
    5 |   int S[N],T[Q];
      |         ^
main.c:5:9: note: each undeclared identifier is reported only once for each function it appears in
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 | #define Q 500
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:27:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   27 |   printf("%d\n",count);
      |   ^~~~~~
main.c:27:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:27:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:27:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#define Q 500

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(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]){
	count++;
	break;
      }
    }
  }
  printf("%d\n",count);
  return 0;
}
       

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:5:9: error: 'N' undeclared (first use in this function)
    5 |   int S[N],T[Q];
      |         ^
main.c:5:9: note: each undeclared identifier is reported only once for each function it appears in
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 | #define Q 500
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:27:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   27 |   printf("%d\n",count);
      |   ^~~~~~
main.c:27:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:27:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:27:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>
#define U 10000

main(){
  int i,j,S[U],T[U],Sn,Tn,count=0;
  scanf("%d",&Sn);
  for(i=0; i<Sn; i++){//入力したSnだけループ
    scanf("%d",&S[i]);
  }
  scanf("%d",&Tn);
  for(j=0; j<Tn; j++){
    scanf("%d",&T[j]);
  }
  for(i=0; i<Sn; i++){
    for(j=0; j<Tn; j++){
      if(S[i]==T[j])count++;
    }
  }
  printf("%d\n",count);
  retun 0;
}

Compiler output:
main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int]
    4 | main(){
      | ^~~~
main.c: In function 'main':
main.c:20:3: error: 'retun' undeclared (first use in this function)
   20 |   retun 0;
      |   ^~~~~
main.c:20:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:8: error: expected ';' before numeric constant
   20 |   retun 0;
      |        ^~
      |        ;
Language: C

#include<stdio.h>
#define U 1000

main(){
  int i,j,S[U],T[U],Sn,Tn,count=0;
  scanf("%d",&Sn);#include<stdio.h>
#define U 1000

main(){
  int i,j,S[U],T[U],Sn,Tn,count=0;
  scanf("%d",&Sn);
  for(i=0; i<Sn; i++){//入力したSnだけループ
    scanf("%d",&S[i]);
  }
  scanf("%d",&Tn);
  for(j=0; j<Tn; j++){
    scanf("%d",&T[j]);
  }
  for(i=0; i<Sn; i++){
    for(j=0; j<Tn; j++){
      if(S[i]==T[j])count++;
      break;//異なる整数なので見付けたらjのループをぬけてもOK
    }
  }
  printf("%d\n",count);
  return 0;
}

  for(i=0; i<Sn; i++){//入力したSnだけループ
    scanf("%d",&S[i]);
  }
  scanf("%d",&Tn);
  for(j=0; j<Tn; j++){
    scanf("%d",&T[j]);
  }
  for(i=0; i<Sn; i++){
    for(j=0; j<Tn; j++){
      if(S[i]==T[j])count++;
      break;//異なる整数なので見付けたらjのループをぬけてもOK
    }
  }
  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:6:19: error: stray '#' in program
    6 |   scanf("%d",&Sn);#include<stdio.h>
      |                   ^
main.c:6:20: error: 'include' undeclared (first use in this function)
    6 |   scanf("%d",&Sn);#include<stdio.h>
      |                    ^~~~~~~
main.c:6:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:28: error: 'stdio' undeclared (first use in this function); did you mean 'stdin'?
    6 |   scanf("%d",&Sn);#include<stdio.h>
      |                            ^~~~~
      |                            stdin
main.c:9:7: error: expected ';' before '{' token
    9 | main(){
      |       ^
      |       ;
Language: C

#include<stdio.h>

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

  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]);
  }

  return 0;
}

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main()
      | ^~~~
main.c: In function 'main':
main.c:8:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanf'
    8 |   scanf("%d",&n);
      |   ^~~~~
main.c:15:17: error: 't' undeclared (first use in this function)
   15 |     scanf("%d",&t[j]);
      |                 ^
main.c:15:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#define N 10000
#define Q 500 
main(){
  int s,t,i,j,count=0;
  int a[N],b[Q];
  scanf("%d", &s);
  for(i=0;i<s;i++)
  {
    scanf("%d", &a[i]);
  }
  scanf("%d", &t);
  for(i=0;i<t;i++)
  {
    scanf("%d", &b[i]);
  }
for(j=0;j<t;j++)#include <stdio.h>
#define N 10000
#define Q 500 
main(){
  int s,t,i,j,count=0;
  int a[N],b[Q];
  scanf("%d", &s);
  for(i=0;i<s;i++)
  {
    scanf("%d", &a[i]);
  }
  scanf("%d", &t);
  for(i=0;i<t;i++)
  {
    scanf("%d", &b[i]);
  }
for(j=0;j<t;j++)
  {
  for(i=0;i<s;i++)
     {
      if(a[i] == b[j])
        count+=1;
        break;
     }
   }
  printf("%d\n", count);
  return 0;
}     
  {
  for(i=0;i<s;i++)
     {
      if(a[i] == b[j])
        count+=1;
        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:17:17: error: stray '#' in program
   17 | for(j=0;j<t;j++)#include <stdio.h>
      |                 ^
main.c:17:18: error: 'include' undeclared (first use in this function)
   17 | for(j=0;j<t;j++)#include <stdio.h>
      |                  ^~~~~~~
main.c:17:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:27: error: 'stdio' undeclared (first use in this function); did you mean 'stdin'?
   17 | for(j=0;j<t;j++)#include <stdio.h>
      |                           ^~~~~
      |                           stdin
main.c:20:7: error: expected ';' before '{' token
   20 | main(){
      |       ^
      |       ;
Language: C

#include <stdio.h>
#define N 10000
#define Q 500 
main(){
  int s,t,i,j,count=0;
  int a[N],b[Q];
  scanf("%d", &s);
  for(i=0;i<s;i++)
  {
    scanf("%d", &a[i]);
  }
  scanf("%d", &t);
  for(i=0;i<t;i++)
  {
    scanf("%d", &b[i]);
  }
for(j=0;j<t;j++)#include <stdio.h>
#define N 10000
#define Q 500 
main(){
  int s,t,i,j,count=0;
  int a[N],b[Q];
  scanf("%d", &s);
  for(i=0;i<s;i++)
  {
    scanf("%d", &a[i]);
  }
  scanf("%d", &t);
  for(i=0;i<t;i++)
  {
    scanf("%d", &b[i]);
  }
for(j=0;j<t;j++)
  {
  for(i=0;i<s;i++)
     {
      if(a[i] == b[j])
        count++;
        break;
     }
   }
  printf("%d\n", count);
  return 0;
}     
  {
  for(i=0;i<s;i++)
     {
      if(a[i] == b[j])
        count+=1;
        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:17:17: error: stray '#' in program
   17 | for(j=0;j<t;j++)#include <stdio.h>
      |                 ^
main.c:17:18: error: 'include' undeclared (first use in this function)
   17 | for(j=0;j<t;j++)#include <stdio.h>
      |                  ^~~~~~~
main.c:17:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:27: error: 'stdio' undeclared (first use in this function); did you mean 'stdin'?
   17 | for(j=0;j<t;j++)#include <stdio.h>
      |                           ^~~~~
      |                           stdin
main.c:20:7: error: expected ';' before '{' token
   20 | main(){
      |       ^
      |       ;
Language: C

include<stdio.h>
#define U 10000
int main(){
  int i,j,S[U],T[U],Sn,Tn,count=0;
  scanf("%d",&Sn);
  for(i=0; i<Sn; i++){//入力したSnだけループ
    scanf("%d",&S[i]);
  }
  scanf("%d",&Tn);
  for(j=0; j<Tn; j++){
    scanf("%d",&T[j]);
  }
  for(i=0; i<Sn; i++){
    for(j=0; j<Tn; j++){
      if(S[i]==T[j])count++;
      break;//異なる整数なので見付けたらjのループをぬけてもOK
    }
  }
  printf("%d\n",count);
  return 0;
}

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

include<stdio.h>
#define U 10000
main(){
  int i,j,S[U],T[U],Sn,Tn,count=0;
  scanf("%d",&Sn);
  for(i=0; i<Sn; i++){//入力したSnだけループ
    scanf("%d",&S[i]);
  }
  scanf("%d",&Tn);
  for(j=0; j<Tn; j++){
    scanf("%d",&T[j]);
  }
  for(i=0; i<Sn; i++){
    for(j=0; j<Tn; j++){
      if(S[i]==T[j])count++;
      break;//異なる整数なので見付けたらjのループをぬけてもOK
    }
  }
  printf("%d\n",count);
  return 0;
}

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

include<stdio.h>
#define U 1000
main(){
  int i,j,S[U],T[U],Sn,Tn,count=0;
  scanf("%d",&Sn);
  for(i=0; i<Sn; i++){//入力したSnだけループ
    scanf("%d",&S[i]);
  }
  scanf("%d",&Tn);
  for(j=0; j<Tn; j++){
    scanf("%d",&T[j]);
  }
  for(i=0; i<Sn; i++){
    for(j=0; j<Tn; j++){
      if(S[i]==T[j])count++;
      break;//異なる整数なので見付けたらjのループをぬけてもOK
    }
  }
  printf("%d\n",count);
  return 0;
}

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

include<stdio.h>
#define Us 10000
#define Uq 500

main(){
  int i,j,S[Us],T[Uq],Sn,Tn,count=0;
  scanf("%d",&Sn);
  for(i=0; i<Sn; i++){//入力したSnだけループ
    scanf("%d",&S[i]);
  }
  scanf("%d",&Tn);
  for(j=0; j<Tn; j++){
    scanf("%d",&T[j]);
  }
  for(i=0; i<Sn; i++){
    for(j=0; j<Tn; j++){
      if(S[i]==T[j])count++;
      break;//異なる整数なので見付けたらjのループをぬけてもOK
    }
  }
  printf("%d\n",count);
  return 0;
}

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

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

int Linearsearch();
int n,S[N],q,T[Q];

int main(){
  int i,j;

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

  //seach
  printf("%d\n", search());
  
  return 0;
}

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

Compiler output:
main.c: In function 'main':
main.c:25:18: error: implicit declaration of function 'search' [-Wimplicit-function-declaration]
   25 |   printf("%d\n", search());
      |                  ^~~~~~
Language: C

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

int Linearsearch(void);
int n,S[N],q,T[Q];

int main(){
  int i,j;

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

  //seach
  printf("%d\n", S[Linearsearch()]);
  
  return 0;
}

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

Compiler output:
main.c:1:2: error: invalid preprocessing directive #Include; did you mean #include?
    1 | #Include<stdio.h>
      |  ^~~~~~~
      |  include
main.c: In function 'main':
main.c:12:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   12 |   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:12:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   12 |   scanf("%d",&n);
      |   ^~~~~
main.c:12: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", S[Linearsearch()]);
      |   ^~~~~~
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 N 10000
#define Q 500

int Linearsearch(int);
int n,S[N],q,T[Q];

int main(){
  int i,j,ans;

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

  //seach
  for(i=0 ; i<q ; i++){
    ans = Linearsearch(T[i])
      if(ans >= 0){
	printf("%d\n",T[ans]);
      }
  }
  return 0;
}

int Linearsearch(int key){
  int j;
    for(j=0 ; j<n ; j++){
      if(S[j]==key)   return j;
    }
    return -1;
}

Compiler output:
main.c: In function 'main':
main.c:26:29: error: expected ';' before 'if'
   26 |     ans = Linearsearch(T[i])
      |                             ^
      |                             ;
   27 |       if(ans >= 0){
      |       ~~
Language: C

#include<stdio.h>

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

  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]) {
	count++;
	break;
      }
      else continue;
    }
  }

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

  return 0;

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

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

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

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

#include<stdio.h>
#include<conio.h> 
int main(){
  int a,b,i,j,count= 0;
  int s[100],t[50];
 
  scanf("%d",&a);
  for(i=0;i<a;i++){
    scanf("%d",s+i);
  }
 
  scanf("%d",&b);
  for(i=0;i<b;i++){
    scanf("%d",t+i);
  }
  
  for(i=0;i<a;i++){
  for(j=0;j<b;j++){
    if(s[i]==t[j]){
    count++;
    t[j]=-1;
    break;
      }
    }
  }
  printf("%d\n",count);
  getch();
}

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

#include<stdio.h>
#include<conio.h>
int main() {
    int s[100],t[100],n,i,j,q,r[100],count=0;
    printf("enter number of n:");
    scanf("%d",&n);
     printf("enter number of q:");
    scanf("%d",&q);
    
    for(i=0;i<n;i++) {
                     printf("\n enter  n inputs:");
                     scanf("%d",&s[i]);
                     
                     for(j=0;j<q;j++) {
                     printf("\n enter  q inputs:"); 
                     scanf("%d",&t[j]); 
                     if(s[i]==t[j]) {
                                    r[j]=s[i];
                                    count++;
                                    }
                     }
               }
               
               printf("no of common things are:%d\n",count);
               printf("\n result is:");
               for(i=0;i<count;i++) {
                                   
                                    printf("%d ",r[i]);
                                    }
                                    
                                    getch();
                                    return 0;
                                    }
                                      
                                 

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

#include<conio.h>
#include<stdio.h>
 
int length(char x[])
{
    int i;
    for(i=0;x[i]!='\0';i++)
    {}
    return i;
}
int main()
{
    char s[20],p[20];
 
int i,l,count=0;
 
printf("\n enter Your String   =  ");
scanf("%s",s);
printf("enter the string to be matched = ");
scanf("%s",p );
l=length(p);
 
    for(i=0;s[i]!='\0';i++)
    {
      if(s[i]==p[count] )
        count++;
    else
    {
        count=0;
    }
      if ( count == l )
        {
            printf("Substring %s found in the given string",p);
         break;
        }
    }
    if(count!=l)
    printf("not found");
 
getch();
}

Compiler output:
main.c:1:9: fatal error: conio.h: No such file or directory
    1 | #include<conio.h>
      |         ^~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
#include <conio.h>
#define max 10000
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);
  getch();
  return 0;
}

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

#include<stdio.h>
int main() {
    int s[100],t[100],n,i,j,q,r[100],count=0;
    printf("enter number of n:");
    scanf("%d",&n);
     printf("enter number of q:");
    scanf("%d",&q);

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

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

               printf("no of common things are:%d\n",count);
               printf("\n result is:");
               for(i=0;i<count;i++) {

                                    printf("%d ",r[i]);
                                    }
                                                                        return 0;
                                    }#include<stdio.h>
#define max 10000
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:30:38: error: stray '#' in program
   30 |                                     }#include<stdio.h>
      |                                      ^
main.c:30:46: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   30 |                                     }#include<stdio.h>
      |                                              ^
Language: C

#include<stdio.h>
int main(){
  int a,b,i,j,count= 0;
  int s[100],t[50];
 
  scanf("%d",&a);
  for(i=0;i<a;i++){
    scanf("%d",s+i);
  }
 
  scanf("%d",&b);
  for(i=0;i<b;i++){
    scanf("%d",t+i);
  }
  
  for(i=0;i<a;i++){
  for(j=0;j<b;j++){
    if(s[i]==t[j]){
    count++;
    t[j]=-1;
    break;
      }
    }
  }
  printf("%d\n",count);
  getch();
}

Compiler output:
main.c: In function 'main':
main.c:26:3: error: implicit declaration of function 'getch'; did you mean 'getc'? [-Wimplicit-function-declaration]
   26 |   getch();
      |   ^~~~~
      |   getc
Language: C

#include<stdio.h>
#define max 10000
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);
  getch();
  return 0;
}

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:18:3: error: implicit declaration of function 'getch'; did you mean 'getc'? [-Wimplicit-function-declaration]
   18 |   getch();
      |   ^~~~~
      |   getc
Language: C

#include<stdio.h>
#include <conio.h>
#define max 10000
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);
  getch();
  return 0

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

#include<stdio.h>
#include <conio.h>
#define max 10000
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);
  getch();
  return 0;
    }

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

#include <stdio.h>
#include <stdlib.h>
?
int main(void){
????int n, q, i, j;
????int *S, *T;
????int cnt;
?
????scanf("%d", &n);
????S = (int*)malloc(sizeof(int)*n);
????for(i = 0; i < n; i++){
????????scanf("%d", S+i);
????}
?????
????scanf("%d", &q);
????T = (int*)malloc(sizeof(int)*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]){
????????????????cnt++;
                break;
????????????}
????????}
????}
?
????printf("%d\n", cnt);
?
????free(S);
????free(T);
?
????return 0;
}

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

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

int main(void){
	int n, q, i, j, cnt=0, t;
	int *S;

	scanf("%d",&n);
	S = malloc(sizoef(int)*n);
	for(i = 0; i < n; i++)	scanf("%d", S[i]);

	scanf("%d", &q);
	
	for(i = 0; i < q; i++){
		scanf("%d", &t);
		for(j = 0; j < n; j++){
			if(S[j]==work){
				cnt++;
				break;
			}
		}
	}

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:20: error: implicit declaration of function 'sizoef' [-Wimplicit-function-declaration]
    9 |         S = malloc(sizoef(int)*n);
      |                    ^~~~~~
main.c:9:27: error: expected expression before 'int'
    9 |         S = malloc(sizoef(int)*n);
      |                           ^~~
main.c:17:34: error: 'work' undeclared (first use in this function)
   17 |                         if(S[j]==work){
      |                                  ^~~~
main.c:17:34: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
using namespace std;

const int MAX_N = 1000000000;
const int MAX_Q = 1000000000;

int S[MAX_N], T[MAX_Q];

int main() {
    int n, q;

    cin >> n;
    for(int i = 0; i < n; i++) {
        cin >> S[i];
    }
    

    cin >> q;
    for(int i = 0; i < q; i++) {
        cin >> T[i];
    }

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

    cout << ans << endl;

    return 0;
}



Compiler output:
/tmp/ccm9LWbC.o: in function `main':
a.cc:(.text+0x8b): relocation truncated to fit: R_X86_64_PC32 against symbol `T' defined in .bss section in /tmp/ccm9LWbC.o
a.cc:(.text+0xf0): relocation truncated to fit: R_X86_64_PC32 against symbol `T' defined in .bss section in /tmp/ccm9LWbC.o
collect2: error: ld returned 1 exit status
Language: C++

#include <cstudio>

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:
a.cc:1:10: fatal error: cstudio: No such file or directory
    1 | #include <cstudio>
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include <studio.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:
a.cc:1:10: fatal error: studio.h: No such file or directory
    1 | #include <studio.h>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<vector>
using namespace std;

int main(void){
	int n, q;
	vector<int> s;
	vector<int> t;
	cin >> n;

	for(int i = 0; i < n; i++){
		cin >> s[i];
	}
	cin >> q;

	for(int i = 0; i < q; i++){
		cin >> t[i];
	}
	sort(s.begin(), s.end());
	int count = 0;
	for(int i = 0; i < q; i++){
		int low = 0, high = s.size()-1;
		while(low <= high){
			int mid = low+high/2
			if(t[i] == s[mid]){
				count++;
				break;
			}
			else if(t[i] > s[mid]){
				low = mid+1;
			}
			else{
				high = mid-1;
			}
		}
	}
	cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   19 |         sort(s.begin(), s.end());
      |         ^~~~
      |         short
a.cc:25:25: error: expected ',' or ';' before 'if'
   25 |                         if(t[i] == s[mid]){
      |                         ^~
a.cc:29:25: error: 'else' without a previous 'if'
   29 |                         else if(t[i] > s[mid]){
      |                         ^~~~
Language: C++

#include<iostream>
#include<vector>
#include<sort>
using namespace std;

int main(void){
	int n, q;
	vector<int> s;
	vector<int> t;
	cin >> n;

	for(int i = 0; i < n; i++){
		cin >> s[i];
	}
	cin >> q;

	for(int i = 0; i < q; i++){
		cin >> t[i];
	}
	sort(s.begin(), s.end());
	int count = 0;
	for(int i = 0; i < q; i++){
		int low = 0, high = s.size()-1;
		while(low <= high){
			int mid = low+high/2;
			if(t[i] == s[mid]){
				count++;
				break;
			}
			else if(t[i] > s[mid]){
				low = mid+1;
			}
			else{
				high = mid-1;
			}
		}
	}
	cout << count << endl;
}


Compiler output:
a.cc:3:9: fatal error: sort: No such file or directory
    3 | #include<sort>
      |         ^~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

int main(void){
	int n, q;
	cin >> n;
	int s[n];

	for(int i = 0; i < n; i++){
		cin >> s[i];
	}
	cin >> q;
	int t[q];

	for(int i = 0; i < q; i++){
		cin >> t[i];
	}
	sort(s.begin(), s.end());
	int count = 0;
	for(int i = 0; i < q; i++){
		int low = 0, high = s.size()-1;
		while(low <= high){
			int mid = low+high/2;
			if(t[i] == s[mid]){
				count++;
				break;
			}
			else if(t[i] > s[mid]){
				low = mid+1;
			}
			else{
				high = mid-1;
			}
		}
	}
	cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:16: error: request for member 'begin' in 's', which is of non-class type 'int [n]'
   20 |         sort(s.begin(), s.end());
      |                ^~~~~
a.cc:20:27: error: request for member 'end' in 's', which is of non-class type 'int [n]'
   20 |         sort(s.begin(), s.end());
      |                           ^~~
a.cc:23:39: error: request for member 'size' in 's', which is of non-class type 'int [n]'
   23 |                 int low = 0, high = s.size()-1;
      |                                       ^~~~
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

int main(void){
	int n, q;
	cin >> n;
	int s[n];

	for(int i = 0; i < n; i++){
		cin >> s[i];
	}
	cin >> q;
	int t[q];

	for(int i = 0; i < q; i++){
		cin >> t[i];
	}
	sort(s, s+n);
	int count = 0;
	for(int i = 0; i < q; i++){
		int low = 0, high = s.size()-1;
		while(low <= high){
			int mid = low+high/2;
			if(t[i] == s[mid]){
				count++;
				break;
			}
			else if(t[i] > s[mid]){
				low = mid+1;
			}
			else{
				high = mid-1;
			}
		}
	}
	cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:39: error: request for member 'size' in 's', which is of non-class type 'int [n]'
   23 |                 int low = 0, high = s.size()-1;
      |                                       ^~~~
Language: C++

#include<iostream>
using namespace std;

int main(void){
	int n, q;
	cin >> n;
	int s[n];

	for(int i = 0; i < n; i++){
		cin >> s[i];
	}

	cin >> q;
	int t[q];

	for(int i = 0; i < q; i++){
		cin >> t[i];
	}
	int count = 0;
	for(int i = 0; i < q; i++){
		for(int j = 0; j < n; j++){
			if(t[i] == s[j]){
				count++;
				break;
			}
			else continue;
		
		}
	}
	cout << count << emdl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:26: error: 'emdl' was not declared in this scope
   30 |         cout << count << emdl;
      |                          ^~~~
Language: C++

#include <stdio.h>

int linearSearch();

int main(){
  int s,t,i,j,A[10001],B[501],C=0;
  scanf("%d",&s);
  for(i=0; i<s; i++) scanf("%d",&A[i]);
  scanf("%d",&t);
  for(j=0; j<t; j++){
    scanf("%d",&B[j]);
    if(linearSearch(B[j], s, A) != -1) C++;
  }
  printf("%d\n",C);
}

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


Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: too many arguments to function 'int linearSearch()'
   12 |     if(linearSearch(B[j], s, A) != -1) C++;
      |        ~~~~~~~~~~~~^~~~~~~~~~~~
a.cc:3:5: note: declared here
    3 | int linearSearch();
      |     ^~~~~~~~~~~~
Language: C++

#include<bits/stdc++.>
using namespace std;

int main() {
    bool c = false;
    int n, q, ans;
    vector<int> S, T;
    cin << n;
    for(int i = 0; i < n; i++) {
        cin >> S.at(i);
    }
    cin >> q;
    for(int i = 0; i < n; i++) {
        cin >> T.at(i);
    }
    for(int i = 0; i < q; i++) {
        for(int j = 0; j < n; j++) {
            if(T.at(i) == S.at(j)) c = true;
        }
    if(c) ans++;
    }
    cout << ans;
}


Compiler output:
a.cc:1:9: fatal error: bits/stdc++.: No such file or directory
    1 | #include<bits/stdc++.>
      |         ^~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main() {
    bool c = false;
    int n, q, ans;
    cin >> n;
    vector<int> S(n)
    for(int i = 0; i < n; i++) {
        cin >> S.at(i);
    }
    cin >> q;
    vector<int> T(q);
    for(int i = 0; i < q; i++) {
        cin >> T.at(i);
    }
    for(int i = 0; i < q; i++) {
        for(int j = 0; j < n; j++) {
            if(T.at(i) == S.at(j)) c = true;
        }
    if(c) ans++;
    }
    cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: expected ',' or ';' before 'for'
    9 |     for(int i = 0; i < n; i++) {
      |     ^~~
a.cc:9:20: error: 'i' was not declared in this scope
    9 |     for(int i = 0; i < n; i++) {
      |                    ^
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main() {
    bool c = false;
    int n, q, ans == 0;
    cin >> n;
    vector<int> S(n);
    for(int i = 0; i < n; i++) {
        cin >> S.at(i);
    }
    cin >> q;
    vector<int> T(q);
    for(int i = 0; i < q; i++) {
        cin >> T.at(i);
    }
    for(int i = 0; i < q; i++) {
        for(int j = 0; j < n; j++) {
            if(T.at(i) == S.at(j)) c = true;
        }
    if(c) ans++;
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:19: error: expected initializer before '==' token
    6 |     int n, q, ans == 0;
      |                   ^~
a.cc:21:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   21 |     if(c) ans++;
      |           ^~~
      |           abs
a.cc:23:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   23 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C++

#include <cstdio.h>
#include <iostream>
using namespace std;

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

  cout << cnt << endl;
  return 0;
}


Compiler output:
a.cc:1:10: fatal error: cstdio.h: No such file or directory
    1 | #include <cstdio.h>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
using namespace std;
#define rep2(x,from,to) for(int x=(from); x<(to); (x)++)
#define rep(x,to) rep2(x,0,to)
vector<int> s, t;
int main() {
	int n, q;
	cin >> n;
	rep(i,n) {
		int a;
		cin >> a;
		s.push_back(a);
	}
	cin >> q;
	rep(i,q) {
		int b;
		cin >> b;
		t.push_back(b);
	}
	int cnt = 0;
	rep(i,q) {
		rep(j,n) {
			if(t[i] == s[j]) {
				cnt++;
				break;
		}
	}
	cout << cnt << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:2: error: expected '}' at end of input
   31 | }
      |  ^
a.cc:7:12: note: to match this '{'
    7 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;

int main(){

  int n, p;
  vector<int> s, t;

  cin >> n;

  for(int i = 0; i < n; i++){
    int a;
    cin >> a;
    s.push_back(a);
  }
  sort(s.begin(),s.end());
  s.erase(unique(s.begin(), s.end()), s.end()); 
  cin >> p;

  for(int i = 0; i < p; i++){
    int a;
    cin >> a;
    t.push_back(a);
  }

  int cnt = 0;

  for(int i = 0; i < n; i++){
    for(int j = 0; j < p; j++){
      if(s[i] == t[j]){
	cnt++;
	//	cout << s[i] << " " << t[j] << endl;
      }
    }
  }

  cout << cnt << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   17 |   sort(s.begin(),s.end());
      |   ^~~~
      |   short
a.cc:18:11: error: 'unique' was not declared in this scope
   18 |   s.erase(unique(s.begin(), s.end()), s.end());
      |           ^~~~~~
Language: C++

#define MAX 1000
int linerSearch(int*, int, int);
int n;

main()
{
  int s[MAX], t[MAX];
  int i, 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++){
	linerSearch(s, n, t[i]);
	  }
  
  return 0;
}

int linerSearch(int *A, int n, int key)
{
  int i=0, count=0;
  A[n] = key;
  
  while(A[n] != key){
	i++;
  }
  if(i!=n) count++;  
  printf("%d\n", count);
}

Compiler output:
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:10:3: error: 'scanf' was not declared in this scope
   10 |   scanf("%d", &n);
      |   ^~~~~
a.cc: In function 'int linerSearch(int*, int, int)':
a.cc:36:3: error: 'printf' was not declared in this scope
   36 |   printf("%d\n", count);
      |   ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | #define MAX 1000
a.cc:37:1: warning: no return statement in function returning non-void [-Wreturn-type]
   37 | }
      | ^