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

import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void printArray (List<Integer> list){
		StringBuilder sb = new StringBuilder();
		sb.append(list.get(0));
		for (int i = 1; i < list.size();i++) {
			sb.append(" ").append(list.get(i));
		}
		System.out.println(sb.toString());
	}

	public static List<List<Integer>> acceptNArray (InputStream ins) {

		return Arrays.asList(sArrays, qArrays);
	}

	public static int howManyIncluded3(List<Integer> sArray, List<Integer> qArray) {

		int howMany = 0;
		qArray.add(1);
		for (int j = 0; j< qArray.size()-1; j++) {
			int key = qArray.get(j);
			qArray.set(qArray.size()-1, key);
			int i = 0;
			while(qArray.get(i) != key) {
				i++;
			}
			if (i == qArray.size()-1) {
				// not found, it reaches to the end
				continue;
			}
			howMany++;
		}
		return howMany;
	}


	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int sNum = sc.nextInt();
		List<Integer> sArrays = new ArrayList<Integer>();
		for (int i = 0; i < sNum; i++) {
			sArrays.add(sc.nextInt());
		}
		List<Integer> qArrays = new ArrayList<Integer>();
		int qNum = sc.nextInt();
		for (int i = 0; i < qNum; i++) {
			qArrays.add(sc.nextInt());
		}
		//List<List<Integer>> arrays = acceptNArray(System.in);
		howManyIncluded3(sArrays, qArrays);
	}
}

Compiler output:
Main.java:20: error: cannot find symbol
		return Arrays.asList(sArrays, qArrays);
		                     ^
  symbol:   variable sArrays
  location: class Main
Main.java:20: error: cannot find symbol
		return Arrays.asList(sArrays, qArrays);
		                              ^
  symbol:   variable qArrays
  location: class Main
2 errors
Language: Java


import java.io.*;
public class Main{
	public static void main(String[] args) throws Exception {
		int n = Integer.parseInt(br.readLine());
		String[] S = br.readLine().split(" ");
		int q = Integer.parseInt(br.readLine());
		String[] T = br.readLine().split(" ");
		int count = 0;
		for(int i = 0; i < q; i++) {
			for(int j = 0; j < n; j++) {
				if (Integer.parseInt(S[i]) == Integer.parseInt(T[j])) {
					count++;
					break;
				}
			}
		}
		System.out.println(count);
	}
}

Compiler output:
Main.java:5: error: cannot find symbol
		int n = Integer.parseInt(br.readLine());
		                         ^
  symbol:   variable br
  location: class Main
Main.java:6: error: cannot find symbol
		String[] S = br.readLine().split(" ");
		             ^
  symbol:   variable br
  location: class Main
Main.java:7: error: cannot find symbol
		int q = Integer.parseInt(br.readLine());
		                         ^
  symbol:   variable br
  location: class Main
Main.java:8: error: cannot find symbol
		String[] T = br.readLine().split(" ");
		             ^
  symbol:   variable br
  location: class Main
4 errors
Language: Java

import java.util.Scanner;

public class Linear
{

    static int[]Sy(int n)
    {	
	Scanner Instd = new Scanner(System.in);
	int []s = new int[n];
	
	for(int i = 0; i < n; i++)
	    {
	        s[i] = Instd.nextInt();
	    }
	return s;
    }

    static int[] Ty(int q)
    {
	Scanner std = new Scanner(System.in);
	int []t = new int[q];
	
	for(int i = 0; i < q; i++)
	    {
	        t[i] = std.nextInt();
	    }
	return t;
    }

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

    public static void main(String[] args)
    {
	Scanner In = new Scanner(System.in);

	int n = In.nextInt();
	int []S = Sy(n);

	int q = In.nextInt();
	int []T = Ty(q);

	int count = 0;

	for(int i = 0; i < q; i++)
	    {
		int a = Search(S,T,q);

	if(a != 0)
	    count++;
	    }

	System.out.println(count);
    }
}

Compiler output:
Main.java:43: error: illegal start of type
	return i;
	^
Main.java:43: error: <identifier> expected
	return i;
	        ^
Main.java:47: error: unnamed classes are a preview feature and are disabled by default.
    public static void main(String[] args)
                  ^
  (use --enable-preview to enable unnamed classes)
Main.java:69: error: class, interface, enum, or record expected
}
^
4 errors
Language: Java

import java.util.*;

class Main {
	//?????¢??¢?´¢?????¬???
	public static int search(int[] A, int n, int key) {
		A[n] = key;
		int i = 0;
		while(A[i] != key)i++;
		if(i == n) {
			return -1;
		} else {
			return i;
		}
	}
	
	public static int search2(int[] A, int n, int key) {
		for ( int i = 0; i < n; i++ ) {
			if ( A[i] == key) return i;
		return false;
		}
	}

	public static void main(String args[]) {

		Scanner scan = new Scanner(System.in);
		int[] arrayS = new int[10001]; //??°???S
		int[] arrayT = new int[501];   //??°???T
		int count = 0;						 //?????°????¨???????????????°

		//????´??????°???????????????ArrayS?????°???S???????????????
		int sNum = scan.nextInt();
		for (int i = 0; i < sNum; i++)
			arrayS[i] = scan.nextInt();

		//????´??????°???????????????ArrayT?????°???T???????????????
		int tNum = scan.nextInt();
		for (int j = 0; j < tNum; j++)
			arrayT[j] = scan.nextInt();

		//??°???T???????´??????°???A????????????????????????????????????
		for (int j = 0; j < tNum; j++)
			if(search2(arrayS, sNum, arrayT[j]) >= 0) count++;

		System.out.println(count);
	}
}

Compiler output:
Main.java:19: error: incompatible types: boolean cannot be converted to int
		return false;
		       ^
1 error
Language: Java

import java.util.*;

class Main {
	//?????¢??¢?´¢?????¬???
	public static int search(int[] A, int n, int key) {
		A[n] = key;
		int i = 0;
		while(A[i] != key)i++;
		if(i == n) {
			return -1;
		} else {
			return i;
		}
	}
	
	public static int search2(int[] A, int n, int key) {
		for ( int i = 0; i < n; i++ ) {
			if ( A[i] == key) return i;
		return -1;
		}
	}

	public static void main(String args[]) {

		Scanner scan = new Scanner(System.in);
		int[] arrayS = new int[10001]; //??°???S
		int[] arrayT = new int[501];   //??°???T
		int count = 0;						 //?????°????¨???????????????°

		//????´??????°???????????????ArrayS?????°???S???????????????
		int sNum = scan.nextInt();
		for (int i = 0; i < sNum; i++)
			arrayS[i] = scan.nextInt();

		//????´??????°???????????????ArrayT?????°???T???????????????
		int tNum = scan.nextInt();
		for (int j = 0; j < tNum; j++)
			arrayT[j] = scan.nextInt();

		//??°???T???????´??????°???A????????????????????????????????????
		for (int j = 0; j < tNum; j++)
			if(search2(arrayS, sNum, arrayT[j]) >= 0) count++;

		System.out.println(count);
	}
}

Compiler output:
Main.java:21: error: missing return statement
	}
	^
1 error
Language: Java

import java.util.*;

class Main {
	//?????¢??¢?´¢?????¬???
	public static int search(int[] A, int n, int key) {
		A[n] = key;
		int i = 0;
		while(A[i] != key)i++;
		if(i == n) {
			return -1;
		} else {
			return i;
		}
	}
	
	public static int search2(int[] A, int n, int key) {
		for ( int i = 0; i < n; i++ ) {
			if ( A[i] == key) return i;
		else return -1;
		}
	}

	public static void main(String args[]) {

		Scanner scan = new Scanner(System.in);
		int[] arrayS = new int[10001]; //??°???S
		int[] arrayT = new int[501];   //??°???T
		int count = 0;						 //?????°????¨???????????????°

		//????´??????°???????????????ArrayS?????°???S???????????????
		int sNum = scan.nextInt();
		for (int i = 0; i < sNum; i++)
			arrayS[i] = scan.nextInt();

		//????´??????°???????????????ArrayT?????°???T???????????????
		int tNum = scan.nextInt();
		for (int j = 0; j < tNum; j++)
			arrayT[j] = scan.nextInt();

		//??°???T???????´??????°???A????????????????????????????????????
		for (int j = 0; j < tNum; j++)
			if(search2(arrayS, sNum, arrayT[j]) >= 0) count++;

		System.out.println(count);
	}
}

Compiler output:
Main.java:21: error: missing return statement
	}
	^
1 error
Language: Java

class Main{
    public static void main(String[] a){
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int[] s=new int[n];
for(int i=0;i<n;i++){
s[i]=sc.nextInt();
}
int q=sc.nextInt();
int[] t=new int[n];
for(int i=0;i<q;i++){
t[i]=sc.nextInt();
}
sc.close();
int ans=0;
for(int i=0;i<q;i++){
for(int j=0;j<n;j++){
if(t[i]==s[j]){
ans++;
break;
}
}
}
System.out.println(ans);
    }
}

Compiler output:
Main.java:3: error: cannot find symbol
Scanner sc=new Scanner(System.in);
^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
Scanner sc=new Scanner(System.in);
               ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

import java.io.*;

public class Main{

	public static void main(String[] args) throws IOException{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] S = new int[n+1];

		String[] s = br.readLine().split(" ")
		for(int i = 0; i < n; i++){
			S[i] = Integer.parseInt(s[i]);
		}
		int q = Integer.parseInt(br.readLine());
		int[] T = new int[q];
		s = br.readLine().split(" ");
		for(int i = 0; i < q; i++){
			T[i] = Integer.parseInt(s[i]);
		}
		
		int C = 0;
		for(int i = 0; i < q; i++){
			boolean flag = linearSearch(T[i], S, n);
			if(flag == true)
				C++;
		}
		System.out.printf("%d\n", C);
	}

	// ????????????????????¢????´¢
	private static boolean linearSearch(int key, int[] A, int n){
		int i = 0;
		A[n] = key;
		while(A[i] != key){
			i++;
		}
		if(i == n)
			return false;
		return true;
	}
}

Compiler output:
Main.java:11: error: ';' expected
		String[] s = br.readLine().split(" ")
		                                     ^
1 error
Language: Java

import java.io.IOException;
import java.util.Scanner;
class Main{
	public static void main(String[] args)throws NumberFormatException, IOException{
//		System.out.println(" ");
		Scanner scan = new Scanner(System.in);
		int finded = 0;
		int lineSamount = scan.nextInt();
		int[] lineSnum = new int[lineSamount];
		for(int i=0; i<lineSamount; i++){
			lineSnum[i] = scan.nextInt();
		}
		int lineTamount = scan.nextInt();
		int[] lineTnum = new int[lineTamount+1];
		for(int i=0; i<lineTamount; i++){
			lineTnum[i] = scan.nextInt();
		}
		int endNum = lineTnum[lineTamount-1];

		for(int i=0; i<lineSamount; i++){
			int j = 0;
			lineTnum[lineTamount] = lineSnum[i];
			while(lineTnum[j] != lineSnum[i]){
				j++;
			if(j == lineTnum.length-1 ){
//				????????????????????£??????
			}
			else {
				finded++;
			}
		}
		System.out.println(finded);
	}
}

Compiler output:
Main.java:34: error: reached end of file while parsing
}
 ^
1 error
Language: Java

package AojLe04;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Le04A {

	public static void main(String[] argc){
		Scanner scanner = new Scanner(System.in);
		int num=0;

		int numA = scanner.nextInt();
		List<Integer> listA = new ArrayList<Integer>();

		for(int i = 0; i < numA; i++){
			Integer wordA = scanner.nextInt();
			listA.add(wordA);
		}

		int numB = scanner.nextInt();
		List<Integer> listB = new ArrayList<Integer>();

		for(int i = 0; i < numB; i++){
			Integer wordB = scanner.nextInt();
			listB.add(wordB);
		}

		for(int i = 0; i < numA ; i++ ){
			for(int j = 0; j < numB; j++){
				if(listA.get(i).equals(listB.get(j))){
					num++;
				}
			}
		}

		System.out.println(num);
	}

}

Compiler output:
Main.java:7: error: class Le04A is public, should be declared in a file named Le04A.java
public class Le04A {
       ^
1 error
Language: Java

package AojLe04;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class ALDS1_2_A {

	public static void main(String[] argc){
		Scanner scanner = new Scanner(System.in);
		int num=0;

		int numA = scanner.nextInt();
		List<Integer> listA = new ArrayList<Integer>();

		for(int i = 0; i < numA; i++){
			Integer wordA = scanner.nextInt();
			listA.add(wordA);
		}

		int numB = scanner.nextInt();
		List<Integer> listB = new ArrayList<Integer>();

		for(int i = 0; i < numB; i++){
			Integer wordB = scanner.nextInt();
			listB.add(wordB);
		}

		for(int i = 0; i < numA ; i++ ){
			for(int j = 0; j < numB; j++){
				if(listA.get(i).equals(listB.get(j))){
					num++;
				}
			}
		}

		System.out.println(num);
	}

}

Compiler output:
Main.java:7: error: class ALDS1_2_A is public, should be declared in a file named ALDS1_2_A.java
public class ALDS1_2_A {
       ^
1 error
Language: Java

package AojLe04;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class ALDS1_4_A {

	public static void main(String[] argc){
		Scanner scanner = new Scanner(System.in);
		int num=0;

		int numA = scanner.nextInt();
		List<Integer> listA = new ArrayList<Integer>();

		for(int i = 0; i < numA; i++){
			Integer wordA = scanner.nextInt();
			listA.add(wordA);
		}

		int numB = scanner.nextInt();
		List<Integer> listB = new ArrayList<Integer>();

		for(int i = 0; i < numB; i++){
			Integer wordB = scanner.nextInt();
			listB.add(wordB);
		}

		for(int i = 0; i < numA ; i++ ){
			for(int j = 0; j < numB; j++){
				if(listA.get(i).equals(listB.get(j))){
					num++;
				}
			}
		}

		System.out.println(num);
	}

}

Compiler output:
Main.java:7: error: class ALDS1_4_A is public, should be declared in a file named ALDS1_4_A.java
public class ALDS1_4_A {
       ^
1 error
Language: Java

package AojLe04;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class ALDS1_4_A {

	public static void main(String[] argc){
		Scanner scanner = new Scanner(System.in);
		int num=0;

		int numA = scanner.nextInt();
		List<Integer> listA = new ArrayList<Integer>();

		for(int i = 0; i < numA; i++){
			Integer wordA = scanner.nextInt();
			listA.add(wordA);
		}

		int numB = scanner.nextInt();
		List<Integer> listB = new ArrayList<Integer>();

		for(int i = 0; i < numB; i++){
			Integer wordB = scanner.nextInt();
			listB.add(wordB);
		}

		for(int i = 0; i < numA ; i++ ){
			for(int j = 0; j < numB; j++){
				if(listA.get(i).equals(listB.get(j))){
					num++;
				}
			}
		}

		System.out.print(num);
	}

}

Compiler output:
Main.java:7: error: class ALDS1_4_A is public, should be declared in a file named ALDS1_4_A.java
public class ALDS1_4_A {
       ^
1 error
Language: Java



import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class ALDS1_4_A {

	public static void main(String[] argc){
		Scanner scanner = new Scanner(System.in);
		int num=0;

		int numA = scanner.nextInt();
		List<Integer> listA = new ArrayList<Integer>();

		for(int i = 0; i < numA; i++){
			Integer wordA = scanner.nextInt();
			listA.add(wordA);
		}

		int numB = scanner.nextInt();
		List<Integer> listB = new ArrayList<Integer>();

		for(int i = 0; i < numB; i++){
			Integer wordB = scanner.nextInt();
			listB.add(wordB);
		}

		for(int i = 0; i < numA ; i++ ){
			for(int j = 0; j < numB; j++){
				if(listA.get(i).equals(listB.get(j))){
					num++;
				}
			}
		}

		System.out.print(num);
	}

}

Compiler output:
Main.java:7: error: class ALDS1_4_A is public, should be declared in a file named ALDS1_4_A.java
public class ALDS1_4_A {
       ^
1 error
Language: Java



import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

 private class ALDS1_4_A {

	public static void main(String[] argc){
		Scanner scanner = new Scanner(System.in);
		int num=0;

		int numA = scanner.nextInt();
		List<Integer> listA = new ArrayList<Integer>();

		for(int i = 0; i < numA; i++){
			Integer wordA = scanner.nextInt();
			listA.add(wordA);
		}

		int numB = scanner.nextInt();
		List<Integer> listB = new ArrayList<Integer>();

		for(int i = 0; i < numB; i++){
			Integer wordB = scanner.nextInt();
			listB.add(wordB);
		}

		for(int i = 0; i < numA ; i++ ){
			for(int j = 0; j < numB; j++){
				if(listA.get(i).equals(listB.get(j))){
					num++;
				}
			}
		}

		System.out.print(num);
	}

}

Compiler output:
Main.java:7: error: modifier private not allowed here
 private class ALDS1_4_A {
         ^
1 error
Language: Java



import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

 public class ALDS1_3_A {

	public static void main(String[] argc){
		Scanner scanner = new Scanner(System.in);
		int num=0;

		int numA = scanner.nextInt();
		List<Integer> listA = new ArrayList<Integer>();

		for(int i = 0; i < numA; i++){
			Integer wordA = scanner.nextInt();
			listA.add(wordA);
		}

		int numB = scanner.nextInt();
		List<Integer> listB = new ArrayList<Integer>();

		for(int i = 0; i < numB; i++){
			Integer wordB = scanner.nextInt();
			listB.add(wordB);
		}

		for(int i = 0; i < numA ; i++ ){
			for(int j = 0; j < numB; j++){
				if(listA.get(i).equals(listB.get(j))){
					num++;
				}
			}
		}

		System.out.print(num);
	}

}

Compiler output:
Main.java:7: error: class ALDS1_3_A is public, should be declared in a file named ALDS1_3_A.java
 public class ALDS1_3_A {
        ^
1 error
Language: Java



import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

 public class sss {

	public static void main(String[] argc){
		Scanner scanner = new Scanner(System.in);
		int num=0;

		int numA = scanner.nextInt();
		List<Integer> listA = new ArrayList<Integer>();

		for(int i = 0; i < numA; i++){
			Integer wordA = scanner.nextInt();
			listA.add(wordA);
		}

		int numB = scanner.nextInt();
		List<Integer> listB = new ArrayList<Integer>();

		for(int i = 0; i < numB; i++){
			Integer wordB = scanner.nextInt();
			listB.add(wordB);
		}

		for(int i = 0; i < numA ; i++ ){
			for(int j = 0; j < numB; j++){
				if(listA.get(i).equals(listB.get(j))){
					num++;
				}
			}
		}

		System.out.print(num);
	}

}

Compiler output:
Main.java:7: error: class sss is public, should be declared in a file named sss.java
 public class sss {
        ^
1 error
Language: Java

import java.util.Scanner;

public class LinearSearch {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] s = new int[n + 1];
		for(int i = 0; i < n; i++) {
			s[i] = sc.nextInt();
		}
		int q = sc.nextInt();
		int[] t = new int[q];
		for(int i = 0; i < q; i++) {
			t[i] = sc.nextInt();
		}
		sc.close();
		int sameValueNum = 0;
		outside: for(int target: t) {
			s[n] = target;
			int index = 0;
			while(true) {
				if(target == s[index]) {
					if(index != n) {
						sameValueNum++;
					}
					continue outside;
				}
				index++;
			}
		}
		System.out.println(sameValueNum);

	}

}

Compiler output:
Main.java:3: error: class LinearSearch is public, should be declared in a file named LinearSearch.java
public class LinearSearch {
       ^
1 error
Language: Java

import java.util.Scanner;

public class Main{
    static Scanner sc = new Scanner(System.in);
    
    private static int[] inputArray(){
        int num = sc.nextInt();
        int[] array = new int[num];
        for(int i = 0; i < num; i++){
            array[i] = sc.nextInt();
        }
        return array;
    }
    
    public static void main(String[] args){
        int[] s = inputArray();
        int[] t = inputArray();
        int count = 0;
        for(int i = 0; i < t.length; i++){
            for(int j = 0; j < s.length; j++){
                if(t[i] == s[j]){
                    count++;
                    break;
                }
            }
        }
        System.out.pritnln(count);
    }
}


Compiler output:
Main.java:27: error: cannot find symbol
        System.out.pritnln(count);
                  ^
  symbol:   method pritnln(int)
  location: variable out of type PrintStream
1 error
Language: Java

import java.util.Scanner;

import static java.lang.System.out;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int size = (scanner.nextInt());
        int [] S= new int[size];
        for (int i = 0; i < size; i++) {
            S[i] = scanner.nextInt();
        }

        int ansSize = (scanner.nextInt());
        int[] T = new int[ansSize];
        for (int i = 0; i < ansSize; i++) {
            T[i] = scanner.nextInt();
        }

        int count = 0;
        for (int i = 0; i <T.length ; i++) {
            for (int j = 0; j < S.length; j++) {
                if(T[i]==S[j]){
                    count++;
                }
            }

        }
        System.out.printf(count);
    }
}


Compiler output:
Main.java:30: error: no suitable method found for printf(int)
        System.out.printf(count);
                  ^
    method PrintStream.printf(String,Object...) is not applicable
      (argument mismatch; int cannot be converted to String)
    method PrintStream.printf(Locale,String,Object...) is not applicable
      (argument mismatch; int cannot be converted to Locale)
1 error
Language: Java

import java.util.ArrayList;
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
    ArrayList<Integer> S = new ArrayList<Integer>();
    ArrayList<Integer> T = new ArrayList<Integer>();
    LinearSearch LS = new LinearSearch();
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    for(int i = 0; i < n; i++)
	S.add(sc.nextInt());
    int q = sc.nextInt();
    for(int i = 0; i < q; i++)
	T.add(sc.nextInt());
    int count = 0;
    for(int i = 0; i < n; i++)
	for(int j = 0; j < q; j++)
	    if(T.get(j) == S.get(i))
		count++;
    System.out.println(count);
    }
}


Compiler output:
Main.java:7: error: cannot find symbol
    LinearSearch LS = new LinearSearch();
    ^
  symbol:   class LinearSearch
  location: class Main
Main.java:7: error: cannot find symbol
    LinearSearch LS = new LinearSearch();
                          ^
  symbol:   class LinearSearch
  location: class Main
2 errors
Language: Java

#include<stdio.h>
int linesearch(int *a,int k,int n);
int main()
{
  int i,j,n,m,alt,cnt=0,iden;
  scanf("%d",&n);
  int a[n+1];
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
  }
  scanf("%d",&m);
  for(j=0;j<m;j++){
    scanf("%d",&alt);
    iden=linesearch(a,alt,n);
    if(iden==1){
      cnt++;
    }
  }
  printf("%d\n",cnt);
  return 0;
}
  int linesearch(int *a, int k,int n){
  int i=0;
  a[n]=k;
  while(a[i]!=k){
    if(i==n-1)return 0;
     i++;
  }
  return 1;
}



Compiler output:
Main.java:1: error: illegal character: '#'
#include<stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include<stdio.h>
        ^
Main.java:7: error: not a statement
  int a[n+1];
         ^
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
int main()
^
  (use --enable-preview to enable unnamed classes)
Main.java:6: error: illegal start of expression
  scanf("%d",&n);
             ^
Main.java:7: error: ']' expected
  int a[n+1];
        ^
Main.java:7: error: ';' expected
  int a[n+1];
           ^
Main.java:9: error: illegal start of expression
    scanf("%d",&a[i]);
               ^
Main.java:11: error: illegal start of expression
  scanf("%d",&m);
             ^
Main.java:13: error: illegal start of expression
    scanf("%d",&alt);
               ^
Main.java:22: error: <identifier> expected
  int linesearch(int *a, int k,int n){
                    ^
Main.java:22: error: class, interface, enum, or record expected
  int linesearch(int *a, int k,int n){
                         ^
Main.java:24: error: class, interface, enum, or record expected
  a[n]=k;
  ^
Main.java:25: error: class, interface, enum, or record expected
  while(a[i]!=k){
  ^
Main.java:27: error: class, interface, enum, or record expected
     i++;
     ^
Main.java:28: error: class, interface, enum, or record expected
  }
  ^
Main.java:30: error: class, interface, enum, or record expected
}
^
17 errors
Language: Java

#include <stdio.h>

int linersearch(int *,int key);
int n;
int q;
int main(){
  int i,j;
  int c=0;
  int S[10000];
  int Q[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",&Q[i]);
  }
  for(i=0; i<n; i++){
    c += linerSearch(Q,S[i]);
  }
  printf("%d\n",c);
  return 0;
}

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




Compiler output:
Main.java:1: error: illegal character: '#'
#include <stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <stdio.h>
         ^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
int n;
^
  (use --enable-preview to enable unnamed classes)
Main.java:9: error: ']' expected
  int S[10000];
        ^
Main.java:10: error: ']' expected
  int Q[10000];
        ^
Main.java:11: error: illegal start of expression
  scanf("%d",&n);
             ^
Main.java:13: error: illegal start of expression
    scanf("%d",&S[i]);
               ^
Main.java:15: error: illegal start of expression
  scanf("%d",&q);
             ^
Main.java:17: error: illegal start of expression
    scanf("%d",&Q[i]);
               ^
Main.java:26: error: <identifier> expected
int linerSearch(int *A,int key){
                   ^
Main.java:26: error: class, interface, enum, or record expected
int linerSearch(int *A,int key){
                       ^
Main.java:28: error: class, interface, enum, or record expected
  A[n] = key;
  ^
Main.java:29: error: class, interface, enum, or record expected
  for(i=0;i<q;i++){
  ^
Main.java:29: error: class, interface, enum, or record expected
  for(i=0;i<q;i++){
          ^
Main.java:29: error: class, interface, enum, or record expected
  for(i=0;i<q;i++){
              ^
Main.java:32: error: class, interface, enum, or record expected
  }
  ^
Main.java:34: error: class, interface, enum, or record expected
}
^
17 errors
Language: Java

#include <stdio.h>

int linersearch(int *,int key);
int n;
int q;
int main(){
  int i,j;
  int c=0;
  int S[10000];
  int Q[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",&Q[i]);
  }
  for(i=0; i<n; i++){
    c += linerSearch(Q,S[i]);
  }
  printf("%d\n",c);
  return 0;
}

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




Compiler output:
Main.java:1: error: illegal character: '#'
#include <stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <stdio.h>
         ^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
int n;
^
  (use --enable-preview to enable unnamed classes)
Main.java:9: error: ']' expected
  int S[10000];
        ^
Main.java:10: error: ']' expected
  int Q[10000];
        ^
Main.java:11: error: illegal start of expression
  scanf("%d",&n);
             ^
Main.java:13: error: illegal start of expression
    scanf("%d",&S[i]);
               ^
Main.java:15: error: illegal start of expression
  scanf("%d",&q);
             ^
Main.java:17: error: illegal start of expression
    scanf("%d",&Q[i]);
               ^
Main.java:26: error: <identifier> expected
int linerSearch(int *A,int key){
                   ^
Main.java:26: error: class, interface, enum, or record expected
int linerSearch(int *A,int key){
                       ^
Main.java:28: error: class, interface, enum, or record expected
  A[n] = key;
  ^
Main.java:29: error: class, interface, enum, or record expected
  for(i=0;i<q;i++){
  ^
Main.java:29: error: class, interface, enum, or record expected
  for(i=0;i<q;i++){
          ^
Main.java:29: error: class, interface, enum, or record expected
  for(i=0;i<q;i++){
              ^
Main.java:32: error: class, interface, enum, or record expected
    }
    ^
Main.java:34: error: class, interface, enum, or record expected
  }
  ^
17 errors
Language: Java

import java.io.*;
import java.util.*;

public class Search1 {
	public static void main(String args[]){
		int n=0,q=0;
		String S_String="", T_String = "";
		int[] S,T;
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		try {
			n = Integer.parseInt(br.readLine());
			S_String = br.readLine();
			q = Integer.parseInt(br.readLine());
			T_String = br.readLine();
		} catch (NumberFormatException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		S = StringToArray(S_String,n);
		T = StringToArray(T_String,q);
		int result = counter(n,q,S,T);
		System.out.println(result);
	}
	private static int counter(int n,int q, int[] S,int[] T){
		int[] temp;
		int buf;
		int counter = 0;
		Arrays.sort(S);
		Arrays.sort(T);
		if(n<q){
			temp=S;
			S = T;
			T = temp;
			buf = n;
			n=q;
			q=buf;
		}
		buf = 0;
		for(int i=0;i<q;i++){
			for(int j=buf;j<n;j++){
				if(S[j]==T[i]){
					counter++;
					break;
				}else if (S[j]>T[i]){
					buf = j;
					break;
				}
			}
		}
		return counter;
	}
	private static int[] StringToArray(String input,int number){
		int[] output = new int[number];
		StringTokenizer st = new StringTokenizer(input," ");
		for(int i=0;i<number;i++){
			output[i] = Integer.parseInt(st.nextToken());
		}
		return output;
	}
}

Compiler output:
Main.java:4: error: class Search1 is public, should be declared in a file named Search1.java
public class Search1 {
       ^
1 error
Language: C

#include<stdio.h>

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


Compiler output:
main.c: In function 'main':
main.c:6:26: error: expected ';' before ')' token
    6 |           for(i=0,i<n,i++){
      |                          ^
      |                          ;
main.c:6:26: error: expected expression before ')' token
main.c:10:26: error: expected ';' before ')' token
   10 |           for(i=0,i<q,i++){
      |                          ^
      |                          ;
main.c:10:26: error: expected expression before ')' token
Language: C

#include<stdio.h>

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


Compiler output:
main.c: In function 'main':
main.c:7:26: error: expected ';' before ')' token
    7 |           for(i=0,i<n,i++){
      |                          ^
      |                          ;
main.c:7:26: error: expected expression before ')' token
main.c:11:26: error: expected ';' before ')' token
   11 |           for(i=0,i<q,i++){
      |                          ^
      |                          ;
main.c:11:26: error: expected expression before ')' token
Language: C

#include<stdio.h>

 int search(int n,int S[],int T){
          int i;
          S[n]=q;
          i=0;
          while(S[i] != q)i++;
          return i != n;
          }
       

 int main(){
          int i,n,T,S[10001],cnt=0,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);
                    if(search(n,S,T))cnt++;
                    }

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


Compiler output:
main.c: In function 'search':
main.c:5:16: error: 'q' undeclared (first use in this function)
    5 |           S[n]=q;
      |                ^
main.c:5:16: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:19:23: error: 'q' undeclared (first use in this function)
   19 |           scanf("%d",&q);
      |                       ^
Language: C

#include<stdio.h>

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

 int main(){
          int i,n,T,S[10001],cnt=0,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);
                    if(search(n,S,T))cnt++;
                    }

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


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

#include <stdio.h>

int search(int*,int,int);

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

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


Compiler output:
main.c:22:6: error: expected identifier or '(' before 'int'
   22 | int (int A[],int n,int key){
      |      ^~~
Language: C

#include <stdio.h>

#define ARRAY_SIZE (8) /* size of array */

int main(void)
{
    int array[ARRAY_SIZE] = {9, 7, 18, 20, 8, 39, 77, 35};
    int key;
    int i;

    puts("find value?");
    scanf("%d", &key);

    for (i = 0; i < ARRAY_SITE; ++i) {
        if (array[i] == key) {
            puts("Found!\n");
            return 0;
        }
    }

    puts("Not Found.\n");
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:14:21: error: 'ARRAY_SITE' undeclared (first use in this function); did you mean 'ARRAY_SIZE'?
   14 |     for (i = 0; i < ARRAY_SITE; ++i) {
      |                     ^~~~~~~~~~
      |                     ARRAY_SIZE
main.c:14:21: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

#define ARRAY_SIZE (8) /* size of array */

int main(void)
{
    int array[ARRAY_SIZE];
    int key;
    int i;

    
    scanf("%d", &key);

    for (i = 0; i < ARRAY_SITE; ++i) {
        if (array[i] == key) {
            puts("Found!\n");
            return 0;
        }
    }

    puts("Not Found.\n");
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:14:21: error: 'ARRAY_SITE' undeclared (first use in this function); did you mean 'ARRAY_SIZE'?
   14 |     for (i = 0; i < ARRAY_SITE; ++i) {
      |                     ^~~~~~~~~~
      |                     ARRAY_SIZE
main.c:14:21: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int A[1000000], n;

int binarySearch(int);

int main(){
  int i, q, k, 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",&k);\
    if(binarySearch(k)) sum++;
  }
  printf("%d\n",sum);

  return 0;
}

int bimarySearch(int key){
  int left=0;
  int righgt=n;
  int mid;
  while(left < right){
    mid=(left+right)/2;
    if(key == A[mid]) return 1;
    if(key > A[mid]) left=mid+1;
    else if(key < A[mid]) right=mid;
  }
  return 0;
}



Compiler output:
main.c: In function 'bimarySearch':
main.c:29:16: error: 'right' undeclared (first use in this function); did you mean 'righgt'?
   29 |   while(left < right){
      |                ^~~~~
      |                righgt
main.c:29:16: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int A[1000000], n;

int binarySearch(int);

int main(){
  int i, q, k, 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",&k);\
    if(binarySearch(k)) sum++;
  }
  printf("%d\n",sum);

  return 0;
}

int bimarySearch(int key){
  int left=0;
  int right=n;
  int mid;
  while(left < right){
    mid=(left+right)/2;
    if(key == A[mid]) return 1;
    if(key > A[mid]) left=mid+1;
    else if(key < A[mid]) right=mid;
  }
  return 0;
}



Compiler output:
/usr/bin/ld: /tmp/ccI6SHYD.o: in function `main':
main.c:(.text+0xb8): undefined reference to `binarySearch'
collect2: error: ld returned 1 exit status
Language: C

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

int LinearSearch(int,int[],int);

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

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

  return 0;
}

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




Compiler output:
main.c: In function 'main':
main.c:16:8: error: implicit declaration of function 'search'; did you mean 'bsearch'? [-Wimplicit-function-declaration]
   16 |     if(search(A,n,key))
      |        ^~~~~~
      |        bsearch
main.c: In function 'LinearSearch':
main.c:24:1: error: number of arguments doesn't match prototype
   24 | int LinearSearch(){
      | ^~~
main.c:4:5: error: prototype declaration
    4 | int LinearSearch(int,int[],int);
      |     ^~~~~~~~~~~~
main.c:26:3: error: 'A' undeclared (first use in this function)
   26 |   A[n] = key;
      |   ^
main.c:26:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:26:5: error: 'n' undeclared (first use in this function)
   26 |   A[n] = key;
      |     ^
main.c:26:10: error: 'key' undeclared (first use in this function); did you mean 'key_t'?
   26 |   A[n] = key;
      |          ^~~
      |          key_t
Language: C

#include<stdio.h>

int LinearSearch(int,int [],int);

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

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

  return 0;
}

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




Compiler output:
main.c: In function 'main':
main.c:15:8: error: implicit declaration of function 'search' [-Wimplicit-function-declaration]
   15 |     if(search(A,n,key))
      |        ^~~~~~
Language: C

#include<stdio.h>

int LinearSearch(int [],int,int);

int main(){
  int i,n,A[10001],j,key;
  int count = 0;

  scanf("%d",&n);
  for(i = 0;i< n;i++){
    scanf("%d",&A[i]);
  }
  scanf("%d",&j);
  for(i = 0;i < j;i++){
    scanf("%d",&key);
    if(LinearSearch(A,n,key))
      count++;
  }
  printf("%d\n",sum);

  return 0;
}

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




Compiler output:
main.c: In function 'main':
main.c:19:17: error: 'sum' undeclared (first use in this function)
   19 |   printf("%d\n",sum);
      |                 ^~~
main.c:19: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[N],t[Q];
  int i,q,n,l=0,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(j=0;j<n;j++){
      if(s[j]==t[i]){
        l++;
        break;
      }
    }
  }

  printf("%d",l);
  printf("\n");
    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

int main( void )
{
    int i,j,c=0,N,q,S[N],t;
    
    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 );
        for ( j = 0; j < n; j++ ) {
            if ( t == s[j] ) {
                t = -1;
            }
        }
        if ( t == -1 ) {
            c++;
        }
    }
    
    printf( "%d\n", c );
    
    return 0;
}



Compiler output:
main.c: In function 'main':
main.c:2:11: error: expected identifier or '(' before numeric constant
    2 | #define N 10000
      |           ^~~~~
main.c:6:17: note: in expansion of macro 'N'
    6 |     int i,j,c=0,N,q,S[N],t;
      |                 ^
main.c:8:19: error: 'n' undeclared (first use in this function)
    8 |     scanf( "%d", &n );
      |                   ^
main.c:8:19: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:23: error: 's' undeclared (first use in this function)
   11 |         scanf( "%d", &s[i] );
      |                       ^
main.c:14:19: error: 'q' undeclared (first use in this function)
   14 |     scanf( "%d", &q );
      |                   ^
main.c:17:23: error: 't' undeclared (first use in this function)
   17 |         scanf( "%d", &t );
      |                       ^
Language: C

#include <stdio.h>

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 (keisan(A, n, key))
			{
				sum++;
			}
		}
	}
	
	printf("%d\n", sum);
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:18:29: error: implicit declaration of function 'keisan' [-Wimplicit-function-declaration]
   18 |                         if (keisan(A, n, key))
      |                             ^~~~~~
Language: C

#include <stdio.h>

#define N 1000000001

int S[N], T[N];

int search(int key, int n){

    int i = 0;

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

    if(i == n) return 0;
    else return 1;
}

int main() {

    int n, q;
    int i;
    int cnt = 0;

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

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


    i = 0;

    while(i < n){
        if(search(S[i], q) == 1){
            cnt++;
        }
        i++;
    }
    printf("%d\n", cnt);

    return 0;
}

Compiler output:
/tmp/ccgNUQg2.o: in function `search':
main.c:(.text+0x21): relocation truncated to fit: R_X86_64_PC32 against symbol `T' defined in .bss section in /tmp/ccgNUQg2.o
main.c:(.text+0x41): relocation truncated to fit: R_X86_64_PC32 against symbol `T' defined in .bss section in /tmp/ccgNUQg2.o
/tmp/ccgNUQg2.o: in function `main':
main.c:(.text+0x104): relocation truncated to fit: R_X86_64_PC32 against symbol `T' defined in .bss section in /tmp/ccgNUQg2.o
collect2: error: ld returned 1 exit status
Language: C

/*
 * Linear Search.c
 *
 *  Created on: 2015/02/15
 */
#include <stdio.h>

int S[10000]={0},T[10000]={0};

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

int main(){
	int n,q;
	int i,j,counter=0;

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

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

	printarray(S,n);
	printarray(T,q);

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

	printf("%d",counter);

	return 0;
}

Compiler output:
main.c:10:17: error: unknown type name 'a'
   10 | void printarray(a[],int n){
      |                 ^
main.c: In function 'main':
main.c:31:9: error: implicit declaration of function 'printarray' [-Wimplicit-function-declaration]
   31 |         printarray(S,n);
      |         ^~~~~~~~~~
Language: C

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

int linearSearch(int i);

int matrix_main[10000+1];
int count_main=0;

int main(){
  int count=0;
  int input;
  int count_sub;
  int i=0,j=0;


  scanf("%d",&count_main);
  while(i != count_main-1){
    scanf("%d",&matrix_main[i]);
    i++;
  }
  
  scanf("%d",&count_sub);

  for(i = 0 ; i < count_sub ; i++ ){
    scanf("%d",&input);
    if(linearSearch(input)){count++;
      //	fprintf(stderr,"now_count :%d\n",count);}
  }
  printf("%d\n",count);
  return 0;
}


int linearSearch(int key){
  int j=0;

  matrix_main[count_main] = key;

  while(matrix_main[j] != key){
    j++;
    if(j == count_main) return 0;
  }
  return j;

}

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

#include <stdio.h>

int main(){
  int S[10000], T[500], count = 0, s, t, i, j;
  scanf("%d",&s);
  for(i = 0; i < s; i++) scanf("%d",&S[i]);
  scanf("%d",&t);
  for(i = 0; i < t; i++) scanf("%d",&T[i]);

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

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

#include <stdio.h>

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

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

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

int main(){
  int i, j, n, q, count = 0;
  int S[sqrt(10, 9)], T[sqrt(10, 9)];

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

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

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:9: error: too many arguments to function 'sqrt'
    6 |   int S[sqrt(10, 9)], T[sqrt(10, 9)];
      |         ^~~~
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:28,
                 from main.c:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:176:1: note: declared here
  176 | __MATHCALL (sqrt,, (_Mdouble_ __x));
      | ^~~~~~~~~~
main.c:6:7: error: size of array 'S' has non-integer type
    6 |   int S[sqrt(10, 9)], T[sqrt(10, 9)];
      |       ^
main.c:6:25: error: too many arguments to function 'sqrt'
    6 |   int S[sqrt(10, 9)], T[sqrt(10, 9)];
      |                         ^~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:176:1: note: declared here
  176 | __MATHCALL (sqrt,, (_Mdouble_ __x));
      | ^~~~~~~~~~
main.c:6:23: error: size of array 'T' has non-integer type
    6 |   int S[sqrt(10, 9)], T[sqrt(10, 9)];
      |                       ^
Language: C

#include<stdio.h>

int main(void)
{
  int S[10000],S2[5000];
  int n,n2,i,j,cou = 0;
  
  scanf("%d",&n);

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



  scanf("%d",&n2);

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

  for(i = 0; i < n2; i++){
    for(j = 0; j < n; j++){
      if(S[j] == S2[i]){
	cou++;
	break;
    }
  }

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

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