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

#include<stdio.h>

int main(){
	int n, q count = 0;
	int datan[100];
	int dataq[100];
	scanf("%d", &n);
	for(int i = 0;i < n;i++){
		scanf("%d", datan[i]);
	}
	scanf("%d", &q);
	for(int i = 0;i < n;i++){
		scanf("%d", data[i]);
	}
	for(int i = 0;i < n;i++){
		for(int j = 0;j < q;j++){
			if(datan[i] == dataq[j])
			count++;
		}
	}
	printf("%d\n", count);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'count'
    4 |         int n, q count = 0;
      |                  ^~~~~
main.c:11:22: error: 'q' undeclared (first use in this function)
   11 |         scanf("%d", &q);
      |                      ^
main.c:11:22: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:29: error: 'data' undeclared (first use in this function); did you mean 'dataq'?
   13 |                 scanf("%d", data[i]);
      |                             ^~~~
      |                             dataq
main.c:18:25: error: 'count' undeclared (first use in this function)
   18 |                         count++;
      |                         ^~~~~
Language: C

#include <stdio.h>
int main(){
  int data_S[100];
  int data_T[100];
  int n ,q ,i ,k ,c=0;
  scanf("%d" ,&n);
  for(i=0 ;i<n ;i++){
    scanf("%d" ,&data_S[i]);
  }
  scanf("%d" ,&q);
  for(k=0 ;k<=q ;k++){
    scanf("%d" ,&data_T[k]);
  }
  for(i=0 ;i<n ;i++){
    for(k=0 ;k<q ;k++){
      if(data_S[i] == data_T[k]){
        cut++;
      }
    }
  }
  printf("%d" ,c);
  return 0;
}

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

#include <stdio.h>
#include <algorithm>
int main(){
  int data_S[100];
  int n ,q ,i ,k ,t ,c=0 ,low=0 ,mid ,high ,T;
  scanf("%d" ,&n);
  for(i=0 ;i<n ;i++){
    scanf("%d" ,&data_S[i]);
  }
  std::sort(&data_S[0] ,&data_S[n-1]);
  scanf("%d" ,&q);
  for(k=0 ;k<q ;k++){
    scanf("%d" ,&T);
  }
  while(1){
    high=n-1;
    mid=(low+high)/2;
    if(data_S(mid) == T){
      c++;
      break
    }
      else if(data_S(mid)<T)low=mid+1;
      else high=mid-1;
  }
  printf("%d\n" ,c);
  return 0;
}

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

#include <stdio.h>
#include <algorithm>

int main() {
    int i, n, q, low = 0, mid, C = 0;
    int S[100000];
    int T[50000];
    scanf("%d", &n);
    for(i = 0; i < n; i++) {
        scanf("%d", &S[i]);
    }
    std::sort(S, S+n);
    scanf("%d", &q);
    for(i = 0; i < q; i++) {
        scanf("%d", &T[i]);
    }
    for(i = 0; i < q; i++) {
        while(1) {
            mid = (n + low) / 2;
            if(S[mid] == T[i]) {
                C++;
                break;
            } else if(S[mid] < T[i]) {
                low = mid + 1;
            } else {
                n = mid - 1;
            }
            if(n < low) {
                break;
            }
        }
    }
    printf("%d\n", C);
    return 0;
}

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

#include <stdio.h>
const int N = 10000000;
int data[N] = {0};
int main(){
  int n ,S ,q ,T ,i ,k ,c=0;
  scanf("%d" ,&n);
  for(i=0 ;i<n ;i++){
    scanf("%d" ,&S);
    if(!data[S])data[S]=1;
  }
  scanf("%d" ,&q);
  for(k=0 ;k<q ;k++){
    scanf("%d" ,&T);
    if(data[T])c++;
  }
  printf("%d\n" ,c);
  return 0;
}

Compiler output:
main.c:3:5: error: variably modified 'data' at file scope
    3 | int data[N] = {0};
      |     ^~~~
Language: C

#include <stdio.h>
#include <algorithm>
int S[100];
int C = 0;

void bound(int n, int m) {
    long int low = 0, high = n - 1, mid, target = m;
    while(1) {
        mid = (high + low) / 2;
        if(S[mid] == target) {
            C++;
            break;
        } else if(S[mid] < target) {
            low = mid + 1;
        } else {
            high = mid - 1;
        }
        if(high < low) {
            break;
        }
    }
}

int main() {
    int i, n, q, t;
    scanf("%d", &n);
    for(i = 0; i < n; i++) {
        scanf("%d", &S[i]);
    }
    std::sort(S, S + n);
    scanf("%d", &q);
    for(i = 0; i < q; i++) {
        scanf("%d", &t);
        bound(n, t);
    }
    printf("%d\n", C);
    return 0;
}

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

#include <stdio.h>
#define MAX_V 500

int main() {
	static int exists_s[MAX_V + 1] = {0}, exist_t[MAX_V + 1] = {0};
	int i, v;
	int n, q, cnt = 0;
	scanf("%d", &n);
	for(i = 0; i < n; i++) {
		scanf("%d", &v);
		exsist_s[v] = 1;
	}
	scanf("%d", &q);
	for(i = 0; i < q; i++) {
		scanf("%d", &v);
		exsist_t[v] = 1;
	}
	for(i = 0; i <= MAX_V; i++) {
		if(exsist_s[i] && exsist_t[i]) {
			cnt++;
		}
	}
	printf("%d\n", cnt);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:17: error: 'exsist_s' undeclared (first use in this function); did you mean 'exist_t'?
   11 |                 exsist_s[v] = 1;
      |                 ^~~~~~~~
      |                 exist_t
main.c:11:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:17: error: 'exsist_t' undeclared (first use in this function); did you mean 'exist_t'?
   16 |                 exsist_t[v] = 1;
      |                 ^~~~~~~~
      |                 exist_t
Language: C

#include <stdio.h>
#define MAX_V 500

int main() {
	static int exists_s[MAX_V + 1] = {0}, exists_t[MAX_V + 1] = {0};
	int i, v;
	int n, q, cnt = 0;
	scanf("%d", &n);
	for(i = 0; i < n; i++) {
		scanf("%d", &v);
		exists_s[v] = 1;
	}
	scanf("%d", &q);
	for(i = 0; i < q; i++) {
		scanf("%d", &v);
		exsists_t[v] = 1;
	}
	for(i = 0; i <= MAX_V; i++) {
		if(exists_s[i] && exists_t[i]) {
			cnt++;
		}
	}
	printf("%d\n", cnt);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:17: error: 'exsists_t' undeclared (first use in this function); did you mean 'exists_t'?
   16 |                 exsists_t[v] = 1;
      |                 ^~~~~~~~~
      |                 exists_t
main.c:16:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main() {
	int n, S[100], q, T[100];
	int i, j, C=0;
	// Get n or S
	scanf("%d",&n);
	for(i=0;i<n;i++) {
		scanf("%d",&S[i]);
	}
	// Get q or T
	scanf("%d",&q);
	for(i=0;i<q;i++) {
		scanf("%d",&T[i]);
		
	}
	C=0;
	for(i=0;i<q;i++) {
		for(j=0;j<n;j++) {
			if (T[i]==S[j]) c++;
		}
	}
	printf("%d\n",C);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:41: error: 'c' undeclared (first use in this function)
   20 |                         if (T[i]==S[j]) c++;
      |                                         ^
main.c:20:41: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <conio.h>

#define S_MAX (100)
#define T_MAX (100)
#define BIGGER (100)
/*
int S[S_MAX];
int T[T_MAX];
*/
int buffer[BIGGER];

void MergeSort( int data[], int size )
{
	int i;
	int j;
	int k;
	int l;
	
	if( size <= 1 )return;
	
	MergeSort( data, size/2 );
	MergeSort( data+size/2, size-size/2 );
	
	i = 0;
	j = size/2;
	k = 0;
	
	while( i < size/2 && j < size )
	{
		if( data[i] < data[j] )
		{
			buffer[k] = data[i];
			k++;
			i++;
		}
		else
		{
			buffer[k] = data[j];
			k++;
			j++;
		}
	}
	
	while( i < size/2 )
	{
		buffer[k] = data[i];
		k++;
		i++;
	}
	while( j < size )
	{
		buffer[k] = data[j];
		k++;
		j++;
	}
	
	for( l = 0; l < size; l++ )
	{
		data[l] = buffer[l];
	}
}

int Serch( int data[], int size, int serch )
{
	int i;
	int j;
	
	if( size <= 1 )
	{
		if( data[0] == serch )return (1);
		else return(0);
	}
	
	if( data[size/2] > serch )
	{
		return (Serch( data, size/2, serch ));
	}
	else
	{
		return (Serch( data+size/2, size-size/2, serch ));
	}
}

int main( void )
{
	int n;
	int q;
	int c;
	int S[S_MAX];
	int T[T_MAX];
	int i;
	
	c = 0;
	
	scanf("%d", &n);
	for( i = 0; i < n; i++ ) scanf("%d",&S[i]);	
	MergeSort( S, n );
	
	scanf("%d", &q);
	for( i = 0; i < q; i++ ) scanf("%d",&T[i]);
	MergeSort( T, q );
	
	if( n < q )
	{
		for( i = 0; i < n; i++ )
		{
			c += Serch( T, q, S[i] );
		}
	}
	else
	{
		for( i = 0; i < q; i++ )
		{
			c += Serch( S, n, T[i] );
		}
	}
	
	printf("%d\n",c);
	
	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 <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <math.h>

int main(){
	int j,i,num,num2,size,k,flg,k,c = 0;
	int n[100],q[100],check[100];
	scanf("%d",&num);
	for(i = 0; i < num; i++){
		scanf("%d",&n[i]);
	}
	scanf("%d",&num2);
	for(i = 0; i < num2; i++){
		scanf("%d",&q[i]);
	}
	for(i = 0; i < num; i++){
		for(j = 0; j < num2; j++){
			if(n[i] == q[j]){
				if(c == 0){
					check[c] = n[i];
					c++;
				}else{
				for(k = 0; k < c; k++){
					flg = 0;
					if(check[k] == n[i]){
						flg = 1;
					}
				}
				if(flg == 0){
					c++;
				}
				}
			}
		}
	}
	printf("%d\n",c);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:37: error: redeclaration of 'k' with no linkage
    8 |         int j,i,num,num2,size,k,flg,k,c = 0;
      |                                     ^
main.c:8:31: note: previous declaration of 'k' with type 'int'
    8 |         int j,i,num,num2,size,k,flg,k,c = 0;
      |                               ^
Language: C

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

int main(){
	int j,i,num,num2,size,k,flg,k,c = 0;
	int n[100],q[100],check[100];
	scanf("%d",&num);
	for(i = 0; i < num; i++){
		scanf("%d",&n[i]);
	}
	scanf("%d",&num2);
	for(i = 0; i < num2; i++){
		scanf("%d",&q[i]);
	}
	for(i = 0; i < num; i++){
		for(j = 0; j < num2; j++){
			if(n[i] == q[j]){
				if(c == 0){
					check[c] = n[i];
					c++;
				}else{
					
					for(k = 0; k < c; k++){
						flg = 0;
						if(check[k] == n[i]){
							flg = 1;
						}
					}
					if(flg == 0){
						c++;
					}
				}
			}
		}
	}
	printf("%d\n",c);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:37: error: redeclaration of 'k' with no linkage
    8 |         int j,i,num,num2,size,k,flg,k,c = 0;
      |                                     ^
main.c:8:31: note: previous declaration of 'k' with type 'int'
    8 |         int j,i,num,num2,size,k,flg,k,c = 0;
      |                               ^
Language: C

#include <stdio.h>

int linearSearch( int *data, int n, int );

int main( void ) {
	int i, n, S[ 100 ], q, tmp, C;
	scanf( "%d", &n );
	for ( i = 0; i < n; i++ )
		scanf( "%d", &S[ i ] );

	C = 0;
	scanf( "%d", &q );
	while ( q-- ) {
		scanf( "%d", &tmp );

		C += linearSearch( S, n, tmp );
	}

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

	return 0;
}

int linearSearch( int *data, int n, int key ) {
	int i;

	for ( i = 0; i < n; i++ )
		if ( S[ i ] == key )
			return 1;

	return 0;
}

Compiler output:
main.c: In function 'linearSearch':
main.c:28:22: error: 'S' undeclared (first use in this function)
   28 |                 if ( S[ i ] == key )
      |                      ^
main.c:28:22: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:5:15: error: invalid suffix "１" on integer constant
    5 |         int S[10１];
      |               ^~~~
main.c:6:15: error: invalid suffix "１" on integer constant
    6 |         int T[10１];
      |               ^~~~
Language: C

#include <stdio.h>
int main()
{
	int n,q;
	int i,j;
	int x[101],y[101];
	int ans=0;
	
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&x[i]);
	
	scanf("%d",&q);
	for(i=0;i<q;i++)
		scanf("%d",&y[i]);
	
	for(i=0;i<n;i++){
		for(j=0;j<q;j+){
			if(x[i] == y[j])
				ans++;
		}
	}
	
	printf("%d\n",ans);
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:18:31: error: expected expression before ')' token
   18 |                 for(j=0;j<q;j+){
      |                               ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:6:30: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    6 |         int S[101]={0},T[101]{0};
      |                              ^
main.c:15:29: error: 'T' undeclared (first use in this function)
   15 |                 scanf("%d",&T[i]);
      |                             ^
main.c:15:29: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main()
{
	int n;
	cin >> n;
	vector<int> s(n);
	for (int& i : s)
		cin >> i;
	int q;
	cin >> q;
	vector<int> t(q);
	for (int& i : t)
		cin >> i;
	int count = 0;
	for (int i = 0; i != t.size(); ++i)
	{
		if (find(s.cbegin(), s.cend(), t[i]) != s.cend())
			count++;
	}
	cout << count << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:25: error: no matching function for call to 'find(std::vector<int>::const_iterator, std::vector<int>::const_iterator, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   19 |                 if (find(s.cbegin(), s.cend(), t[i]) != s.cend())
      |                     ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:19:25: note:   '__gnu_cxx::__normal_iterator<const int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   19 |                 if (find(s.cbegin(), s.cend(), t[i]) != s.cend())
      |                     ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <stdio.h>

int search(int data1[], int data2[], int n, int n2) {
    int count = 0;
    for(int i = 0; i < n; i+;) {
        for(int j = 0; j < n2; j++) {
            if(data1[i] == data2[j]) count++;
        }
    }
    return count;
}

int main() {
    int n, n2;
    int data1[100], data2[100];
    
    //入力
    scanf("%d", &n);
    for(int i = 0; i < n; i++) scanf("%d", data1[i]);
    scanf("%d", &n2);
    for(int i = 0; i < n2; i++) scanf("%d", data2[i]);
    //

    printf("%d", search(data1, data2, n, n2));
    return 0;
}

Compiler output:
a.cc: In function 'int search(int*, int*, int, int)':
a.cc:5:29: error: expected primary-expression before ';' token
    5 |     for(int i = 0; i < n; i+;) {
      |                             ^
a.cc:5:29: error: expected ')' before ';' token
    5 |     for(int i = 0; i < n; i+;) {
      |        ~                    ^
      |                             )
a.cc:5:30: error: expected primary-expression before ')' token
    5 |     for(int i = 0; i < n; i+;) {
      |                              ^
Language: C++

#include <stdio.h>

int search(int data1[], int data2[], int n, int n2) {
    int count = 0;
    for(int a = 0; a < n2; a++) {
        for(int b = 0; b < n; b++) {
            if(data[b] == data2[a]) {
                count++;
                break;
            }
        }
    }
    return count;
}

int main() {
    int n, n2;
    int data1[100000], data2[50000];
    

    scanf("%d", &n);
    for(int i = 0; i < n; i++) scanf("%d", &data1[i]);
    scanf("%d", &n2);
    for(int j = 0; j < n2; j++) scanf("%d", &data2[j]);

    printf("%d\n", search(data1, data2, n, n2));
    return 0;
}

Compiler output:
a.cc: In function 'int search(int*, int*, int, int)':
a.cc:7:16: error: 'data' was not declared in this scope; did you mean 'data1'?
    7 |             if(data[b] == data2[a]) {
      |                ^~~~
      |                data1
Language: C++

#include<stdio.h>


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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:30: error: 's' was not declared in this scope
    8 |                 scanf("%d", &s[i]);
      |                              ^
a.cc:12:30: error: 't' was not declared in this scope
   12 |                 scanf("%d", &t[i]);
      |                              ^
a.cc:16:28: error: 's' was not declared in this scope
   16 |                         if(s[i]==t[j]){
      |                            ^
a.cc:16:34: error: 't' was not declared in this scope
   16 |                         if(s[i]==t[j]){
      |                                  ^
Language: C++

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

int n;
int data1[10000];

int nibun(int data) {
    int low,high,mid;
    low=0;high= n -1;
    while(low<=high) {
        mid=(low+high)/2;
        if(data1[mid]==data)return 1;
        else if(data1[mid]<data)low=mid+1;
        else high=mid-1;
    }
    return 0;
}
/* syo-zyun */
int qsort_comp(const void* x,const void* y) {
    int* a=(int*)x;
    int* b=(int*)y;
    if(*a>*b)return 1;
    if(*a<*b)return -1;
    return 0;
}


int main(){
	int q,i,data2[1000],count=0;
	scanf("%d", &n);
	for(i=0;i<n;i++){
		scanf("%d", &data1[i]);
	}
	qsort(S,S_max,sizeof(int),qsort_comp);
	scanf("%d", &q);
	for(i=0;i<q;i++){
		scanf("%d", &data2[i]);
		if(nibun(data2[i]))count++;
	}
	printf("%d\n", count);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:15: error: 'S' was not declared in this scope
   34 |         qsort(S,S_max,sizeof(int),qsort_comp);
      |               ^
a.cc:34:17: error: 'S_max' was not declared in this scope
   34 |         qsort(S,S_max,sizeof(int),qsort_comp);
      |                 ^~~~~
Language: C++

using namespace std;
void input_shugo(int,int[]);
int binary_search_self(int[],int,int);
int main(){
    int S[100000],T[50000];
    int n,q,result=0;
    
    scanf("%d",&n);
    input_shugo(n, S);
    std::sort(&S[0],&S[n]);

    scanf("%d",&q);
    input_shugo(q, T);
    std::sort(&T[0],&T[q]);
   
    for (int i=0; i<q; i++){
        result += binary_search_self(S,n,T[i]);
    }
    
    printf("%d\n",result);
}


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

int binary_search_self(int search_data[],int n,int search_value){
    int max = n-1;
    int min = 0;
    int mid;
    while(min<= max) {
        mid = (max + min) / 2; 
        if (search_data[mid] == search_value) {
            return 1;
            
        } else if (search_data[mid] < search_value) {
            min = mid + 1; 
        } else {
            max = mid - 1; 
        }
    }
    return 0;
} 	 

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'scanf' was not declared in this scope
    8 |     scanf("%d",&n);
      |     ^~~~~
a.cc:10:10: error: 'sort' is not a member of 'std'
   10 |     std::sort(&S[0],&S[n]);
      |          ^~~~
a.cc:14:10: error: 'sort' is not a member of 'std'
   14 |     std::sort(&T[0],&T[q]);
      |          ^~~~
a.cc:20:5: error: 'printf' was not declared in this scope
   20 |     printf("%d\n",result);
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | using namespace std;
a.cc: In function 'void input_shugo(int, int*)':
a.cc:26:9: error: 'scanf' was not declared in this scope
   26 |         scanf("%d",&shugo[i]);
      |         ^~~~~
Language: C++

 #include<stdio.h>
#include <algorithm>
using namespace std;
void input_shugo(int,int[]);
int binary_search_self(int[],int,int);
int main(){
    int S[100000],T[50000];
    int n,q,result=0;
    
    scanf("%d",&n);
    input_shugo(n, S);
    std::sort(&S[0],&S[n]);

    scanf("%d",&q);
    input_shugo(q, T);
    std::sort(&T[0],&T[q]);
   
    for (int i=0; i<q; i++){
        result += binary_search_self(S,n,T[i]);
    }
    
    printf("%d\n",result);
}


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

int binary_search_self(int search_data[],int n,int search_value){
    int max = n-1;
    int min = 0;
    int mid;
    while(min<= max) {
        mid = (max + min) / 2; 
        if (search_data[mid] == search_value) {
            return 1;
            
        } else if (search_data[mid] < search_value) {
            min = mid + 1; 
        } else {
            max = mid - 1; 
        }
    }
    return 0;
} 	 

Compiler output:
a.cc:3:3: error: stray '\36' in program
    3 | us<U+001E>ing namespace std;
      |   ^~~~~~~~
a.cc:11:23: error: stray '\36' in program
   11 |     input_shugo(n, S);<U+001E>
      |                       ^~~~~~~~
a.cc:3:1: error: 'us' does not name a type
    3 | using namespace std;
      | ^~
Language: C++

#include<stdio.h>

int main(){

int n[501]={};
int m[501]={};
int x,y,z;

scanf("%d",&y);

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


scanf("%d",&y);
for(int i=0;i<y;i++)
{scanf("%d",&x);mm[x]++;}
int ccc=0;
bool P=true;
for(int i=0;i<501;i++)
if(n[i]==m[i]){//if(P!=true)printf(" ");
ccc++;P=false;}

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

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: 'mm' was not declared in this scope; did you mean 'm'?
   17 | {scanf("%d",&x);mm[x]++;}
      |                 ^~
      |                 m
Language: C++

#include <iostream>
using namespace std;

int main(){
	int n , q , count=0;
	int i,j;
	cin >> n;
	int s[n]
	for(i=0; i<n ; i++){
		cin>>s[i];
	}
	cin>> q;
	int t[q];
	for(i=0 ; i<q ; i++){
		cin>>t[i];
	}
	for(i=0 ; i<q ; i++){
		for(j=0 ; j<n ; j++){
			if(t[i]==s[j]){
				count++;
				break;
			}
		}
	}
	cout << count << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: expected initializer before 'for'
    9 |         for(i=0; i<n ; i++){
      |         ^~~
a.cc:9:27: error: expected ';' before ')' token
    9 |         for(i=0; i<n ; i++){
      |                           ^
      |                           ;
a.cc:19:34: error: 's' was not declared in this scope
   19 |                         if(t[i]==s[j]){
      |                                  ^
Language: C++

#include<stdio.h>

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

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

int main(){
    int a,b,i,r,s[100],t[100],count;
    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(r=0;r<b;r++){
            if(s[r]==t[i]){
                count++;
                break;
            }
        }
    }
    printf("%d\n",count);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'scanf' was not declared in this scope
    3 |     scanf("%d",&a);
      |     ^~~~~
a.cc:19:5: error: 'printf' was not declared in this scope
   19 |     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 | int main(){
Language: C++

#include <stdio.h>
#include <algorithm>
int main(){
	int c= 0, i, n, s[100], q, t[100], low, mid, high;
	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]);
	}
	std::sort(s, s + n);//
	for(i = 0; i < q; i++){
		high = n - 1;
		low = 0;
		while(1){
			mid = (high + low)/2;
			if(s[mid] == t[i]){
				c++;
				break;
			}else{
				if(s[mid] < t[i]){
					low = mid + 1;
				}else{
					high = mid - 1;
				}
			}
			if(hihg < low) break;
		}
	}
	printf("%d\n", c);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:28: error: 'hihg' was not declared in this scope; did you mean 'high'?
   29 |                         if(hihg < low) break;
      |                            ^~~~
      |                            high
Language: C++

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

int main(){
	int i,j;
	int n,q,flag;
	int *sans;
	int *tans;

	flag=0;

	scanf("%d",&n);
	sans=(int *)malloc(n);
	for(i=0;i<n;i++){
		scanf("%d",&(sans[i]);
	}
	scanf("%d",&q);
	tans=(int *)malloc(q);
	for(j=0;j<q;j++){
		scanf("%d",&(tans[j]);
	}
	for(j=0;j<q;j++){
		for(i=0;i<n;i++){
			if(tans[j]==sans[i])flag++;
		}
	}

	printf("%d\n",flag);
	free(sans);
	free(tans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:38: error: expected ')' before ';' token
   15 |                 scanf("%d",&(sans[i]);
      |                      ~               ^
      |                                      )
a.cc:20:38: error: expected ')' before ';' token
   20 |                 scanf("%d",&(tans[j]);
      |                      ~               ^
      |                                      )
Language: C++

#include <stdio.h>
#include <algorithm>
int main(){
  int data_S[100];
  int n ,q ,i ,k ,t ,c=0 ,low=0 ,mid ,high ,T;
  scanf("%d" ,&n);
  for(i=0 ;i<n ;i++){
    scanf("%d" ,&data_S[i]);
  }
  std::sort(&data_S[0] ,&data_S[n-1]);
  scanf("%d" ,&q);
  for(k=0 ;k<q ;k++){
    scanf("%d" ,&T);
  }
  while(1){
    high=n-1;
    mid=(low+high)/2;
    if(data_S(mid) == T){
      c++;
      break
    }
      else if(data_S(mid)<T)low=mid+1;
      else high=mid-1;
  }
  printf("%d\n" ,c);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:14: error: 'data_S' cannot be used as a function
   18 |     if(data_S(mid) == T){
      |        ~~~~~~^~~~~
a.cc:20:12: error: expected ';' before '}' token
   20 |       break
      |            ^
      |            ;
   21 |     }
      |     ~       
a.cc:22:21: error: 'data_S' cannot be used as a function
   22 |       else if(data_S(mid)<T)low=mid+1;
      |               ~~~~~~^~~~~
Language: C++

#include<stdio.h>
#include <algorithm>
int main(){
  printf("3-3\n");
  int n, q, x, i, k, count=0, low,high, mid;
  #define max 100
  int S[max];
  scanf("%d", &n);
  for(i=0;i<n;i++){
    scanf("%d", &S[i]);
  }
  std::sort(S, S+n);
  scanf("%d", &q);
  for(i=0;i<q;i++){
    scanf("%d", &x);/
    low = 0; high = n-1;
    for(;;){
      mid = (low+high)/2;
      if(S[mid] == x){
        count++;
        break;
      }else if(S[mid] < x){
        low = mid + 1;
      }else{
        high = mid - 1;
      }
      if(high < low){
        break;
      }
    }
  }
  printf("%d\n", count);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:21: error: expected primary-expression before '/' token
   15 |     scanf("%d", &x);/
      |                     ^
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;


int main(){
  int i, j, k, ans, nn, nq, n[101];

  cin >> nn;

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

  for(i=0, ans=0; i<nq; i++){
    cin >> k;
	for(j=0; j<nn; j++) {
		if(k==n[j]) ans++;
	}

}

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

include<iostream>
using namespace std;
int main(){
  int n,q;
  int s[128],t[128];
  int cnt=0;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>s[i];
  }
  cin >> q;
  for(int i=0;i<q;i++){
    cin>>t[i];
  }
  for(int i=0;i<n;i++){
    for(int j=0;j<q;j++){
      if(t[i]==s[j]){
	cnt=cnt+1;
	break;
      }
    }
  }
  cout<<cnt<<endl;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin>>n;
      |   ^~~
a.cc:23:3: error: 'cout' was not declared in this scope
   23 |   cout<<cnt<<endl;
      |   ^~~~
a.cc:23:14: error: 'endl' was not declared in this scope
   23 |   cout<<cnt<<endl;
      |              ^~~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(){

	int n,q;
	vector<int> s;
	vector<int> t;
	cin>>n;
	for(int i=0;i<n;i++){
		int num;
		cin>>num;
		s.push_back(num);
	}

	cin>>q;
	for(int j=0;j<q;j++){
		int temp;
		cin>>temp;
		t.push_back(temp);
	}
	
	int c = 0;
	for(int k=0;k<n;k++){
		for(int l=0;l<q;l++){
			if(s[k] == t[l]{ c++;
			break;	
			}
			}
	}
	cout<<c<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:40: error: expected ')' before '{' token
   26 |                         if(s[k] == t[l]{ c++;
      |                           ~            ^
      |                                        )
a.cc:29:25: error: expected primary-expression before '}' token
   29 |                         }
      |                         ^
Language: C++

#include<iostream>
#include<vector>

#define     MAX_COUNT_N     100
#define     MAX_COUNT_Q     100

using namespace std;

int main(){
	int n,q,cnt = 0;
	vector<int> S,T;
	int i,j,buf;

	// 集合 S の個数を入力
	cin >> n;

	// 入力のチェック
	if((n < 1) || (n > ((int)(MAX_COUNT_N)))){
		cerr << "Error : The input number is out of range." << endl;
		return -1;
	}

	// 集合 S の中身を入力
	for(i=0;i<n;i++){
		cin >> buf;
		S.push_back(buf);
	}

	// 集合 T の個数を入力
	cin >> q;

	// 入力のチェック
	if((q < 1) || (q > ((int)(MAX_COUNT_Q)))){
		cerr << "Error : The input number is out of range." << endl;
		return -1;
	}

	// 集合 T の中身を入力
	for(i=0;i<q;i++){
		cin >> buf;
		T.push_back(buf);
	}

	// 検索
	for(i=0;i < ((int)(T.size()));i++){
		for(j=0;j < ((int)(S.size()));j++){
			if((*(S[j])) == (*(T[i]))){
				cnt++;
			}
		}
	}

	// 出力
	cout << cnt << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:29: error: invalid type argument of unary '*' (have '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'})
   47 |                         if((*(S[j])) == (*(T[i]))){
a.cc:47:42: error: invalid type argument of unary '*' (have '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'})
   47 |                         if((*(S[j])) == (*(T[i]))){
Language: C++




#include <stdio.h> main(){    int i, j, n, S[100], q, T[100], count = 0, buf = 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 (buf == S[j]) continue;        else if (S[j] == T[i]) {        count++;        buf = S[j];        }    }    }    printf("%d\n", count);         return 0;} 

Compiler output:
a.cc:4:20: warning: extra tokens at end of #include directive
    4 | #include <stdio.h> main(){    int i, j, n, S[100], q, T[100], count = 0, buf = 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 (buf == S[j]) continue;        else if (S[j] == T[i]) {        count++;        buf = S[j];        }    }    }    printf("%d\n", count);         return 0;}
      |                    ^~~~
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#define s scanf("%d",&a)
int c[999];int main(a,b,d){for(s,b=a;b--;c[a]=s);for(s,b=a;b--;d+=c[a])s;printf("%d\n",d);}

Compiler output:
a.cc:2:16: error: cannot declare '::main' to be a global variable
    2 | int c[999];int main(a,b,d){for(s,b=a;b--;c[a]=s);for(s,b=a;b--;d+=c[a])s;printf("%d\n",d);}
      |                ^~~~
a.cc:2:21: error: 'a' was not declared in this scope
    2 | int c[999];int main(a,b,d){for(s,b=a;b--;c[a]=s);for(s,b=a;b--;d+=c[a])s;printf("%d\n",d);}
      |                     ^
a.cc:2:23: error: 'b' was not declared in this scope
    2 | int c[999];int main(a,b,d){for(s,b=a;b--;c[a]=s);for(s,b=a;b--;d+=c[a])s;printf("%d\n",d);}
      |                       ^
a.cc:2:25: error: 'd' was not declared in this scope
    2 | int c[999];int main(a,b,d){for(s,b=a;b--;c[a]=s);for(s,b=a;b--;d+=c[a])s;printf("%d\n",d);}
      |                         ^
a.cc:2:26: error: expression list treated as compound expression in initializer [-fpermissive]
    2 | int c[999];int main(a,b,d){for(s,b=a;b--;c[a]=s);for(s,b=a;b--;d+=c[a])s;printf("%d\n",d);}
      |                          ^
Language: C++


/*
ファイル名：Sample.java
学生証番号:144155
氏名:今江健悟
説明:


 */

import java.util.Scanner;

public class Main
{
    
    public void Main()
    {

    }

    public static void main(String[] args)
    {
        int[] setS = new int[128];
        int[] setT = new int[128];
        int total = 0;
        Scanner scan = new Scanner(System.in);
	
        int n = scan.nextInt();
        for(int i=0; i < n; i++)
        {
            int val1 = scan.nextInt();
            //System.out.println(": "+ val1);
            setS[i] = val1;
        }
        
        int q = scan.nextInt();
        for(int i=0; i < q; i++)
        {
            int val2 = scan.nextInt();
            //System.out.println(": "+ val2);
            setT[i] = val2;
        }
        
        boolean flag = true;
        for(int i=0; i < q; i++)
        {
            for(int j=0; j < n; j++)
            {
                if(setS[j] == setT[i] && flag)
                {
                    flag = false;
                    total++;
                }
            }
            flag = true;
        }
        
        System.out.println(total);
        
    }
}

Compiler output:
a.cc:11:1: error: 'import' does not name a type
   11 | import java.util.Scanner;
      | ^~~~~~
a.cc:11:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:13:1: error: expected unqualified-id before 'public'
   13 | public class Main
      | ^~~~~~
Language: C++

int main(void){
	int	n,*S,q,T,sum=0;

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

	cin >> q;
	for(int i=0;i<q;i++){
		cin >> T;
		for(int j=0;j<n;j++)
			if(S[j]==T){
				sum++;
				break;
			}
	}
	cout << sum << endl;

	delete [] S;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
    4 |         cin >> n;
      |         ^~~
a.cc:18:9: error: 'cout' was not declared in this scope
   18 |         cout << sum << endl;
      |         ^~~~
a.cc:18:24: error: 'endl' was not declared in this scope
   18 |         cout << sum << endl;
      |                        ^~~~
Language: C++

#include <stdio.h>

int main(void)
{
    int n=0,m=0,i=0,j=0,count=0,tmp=0;
    scanf("%d",&n);
    int a[n];
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
    }
    for(i=0;i<n-1;i++) {
        for(j=n-1;j>i;j--){
            if(a[j-1]>a[j]){
                tmp=a[j];
                a[j]=a[j-1];
                a[j-1]=tmp;
            }
        }
    }
    
    //printf("-----\n");
    
    scanf("%d",&m);
    int b[m];
    for(i=0;i<m;i++){
        scanf("%d",&b[i]);
    }
    for(i=0;i<m-1;i++) {
        for(j=m-1;j>i;j--){
            if(b[j-1]>a[j]){
                tmp=b[j];
                b[j]=b[j-1];
                b[j-1]=tmp;
            }
        }
    }
    if(n>m){
        for(i=0;i<n;i++){
            if(a[i]==a[i+1]){
                
            }else{
                for(j=0;j<m;j++){
                    if(b[j]==j[j+1]){
                        
                    }else if(a[i]==b[j])count++;
                }
            }
            
        }
    }else{
        for(i=0;i<m;i++){
            if(b[i]==b[i+1]){
                
            }else{
                for(j=0;j<n;j++){
                    if(a[j]==a[j+1]){
                        
                    }else if(b[i]==a[j])count++;
                }
            }
            
        }
    }
    printf("%d\n",count);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:31: error: invalid types 'int[int]' for array subscript
   43 |                     if(b[j]==j[j+1]){
      |                               ^
Language: Java

import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int a = sc.nextInt();
			int b = 0, c = 0;
			String d, e;
			int g = 0, h = 0;
			for (int i = 0; i < a; i++) {
				d = sc.next();
				e = sc.next();
				int f = d.compareTo(e);
				if (f == -1) {
					g += 3;
				} else if (f == 0) {
					g += 1;
					h += 1;
				} else if (f == 1) {
					h += 3;
				}
			}
		}
		System.out.println(g + " " + h);
	}
}

Compiler output:
Main.java:25: error: cannot find symbol
		System.out.println(g + " " + h);
		                   ^
  symbol:   variable g
  location: class Main
Main.java:25: error: cannot find symbol
		System.out.println(g + " " + h);
		                             ^
  symbol:   variable h
  location: class Main
2 errors
Language: C

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

int main(){
	int i,j,k;
	int count=0,counter;
	int a=0,b=0;
	char c[101],d[101];
	scanf("%d",&counter);
	while(count<counter){
		scanf("%s %s",&c,&d);
		i=0;
		while(c[i]==d[i]&&i<=100&&c[i]!=0&&d[i]!=0){
			i++;
		}
		i>100||c[i]==0||d[i]==0?a++,b++:c[i]<d[i]?b+=3:a+=3;
		count++;
	}
	printf("%d %d\n",a,b);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:65: error: lvalue required as left operand of assignment
   16 |                 i>100||c[i]==0||d[i]==0?a++,b++:c[i]<d[i]?b+=3:a+=3;
      |                                                                 ^~
Language: C

#include <stdio.h>
#include <string.h>
int main(void)
{
	int i;
	int count=0,counter;
	int a=0,b=0;
	char c[101],d[101];
	scanf("%d",&counter);
	while(count<counter){
		scanf("%s %s",&c,&d);
		i=0;
		while(c[i]==d[i]&&i<=100&&c[i]!=0&&d[i]!=0){
			i++;
		}
		i>100||c[i]==0||d[i]==0?a++,b++:c[i]<d[i]?b+=3:a+=3;
		count++;
	}
	printf("%d %d\n",a,b);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:65: error: lvalue required as left operand of assignment
   16 |                 i>100||c[i]==0||d[i]==0?a++,b++:c[i]<d[i]?b+=3:a+=3;
      |                                                                 ^~
Language: C

#include<stdio.h>
int main(void){
    int n,c=0,b=0;
    int i,j,k,l;
    char a[1001][2][101];
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%s",a[i][0]);
        scanf("%s",a[i][1]);
        j=0;
        while(1){
            if(a[i][0][j]=='\0'&&a[i][1][j]=='\0'){
                c++;
                b++;
                break;
            }
            else if(a[i][0][j]-'a'<a[i][1][j]-'a'){
                c=c+3;
                break;
            }
            else if(a[i][0][j]-'a'>a[i][1][j]-'a'){
                b=b+3;
                break;
            }
            j++;
        }
    }
    printf("%d %d\n",d,c);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:28:22: error: 'd' undeclared (first use in this function)
   28 |     printf("%d %d\n",d,c);
      |                      ^
main.c:28:22: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(void){
    int n,c=0,b=0;
    int i,j,k,l;
    char a[1001][2][101];
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%s",a[i][0]);
        scanf("%s",a[i][1]);
        j=0;
        while(1){
            if(a[i][0][j]=='\0'&&a[i][1][j]=='\0'){
                c++;
                b++;
                break;
            }
            else if(a[i][0][j]-'a'>a[i][1][j]-'a'){
                c=c+3;
                break;
            }
            else if(a[i][0][j]-'a'<a[i][1][j]-'a'){
                b=b+3;
                break;
            }
            j++;
        }
    }
    printf("%d %d\n",c,d);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:28:24: error: 'd' undeclared (first use in this function)
   28 |     printf("%d %d\n",c,d);
      |                        ^
main.c:28:24: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <iostream>
#include <cstring>

using namespace std;
int main(){
    string s1, s2;
    int t;
    int p_h = 0, p_t = 0;

    cin >> t;
    for(int i=0;i<t;i++){
      cin >> s1 >> s2;
      if ( s1 > s2 ){
	p_h += 3;
      }else if ( s2 > s1 ){
         p_t += 3;
      }else{
        p_h++;
	p_t++;
      }
    }
    cout << p_h << " " << p_t << endl;
    return 0;
}

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

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

int main()
{
	char taro[1001][101],hanako[1001][101];
	int turn,tarop=0,hanap=0;
	
	scanf("%d",&turn);
	
	for(i=0;i<turn;i++){
		scanf("%s %s",taro[i],hanako[i]);
		if(strcmp(taro[i],hanako[i])>0){
			tarop+=3;
		}else if(strcmp(taro[i],hanako[i])<0){
			hanap+=3;
		}else{
			tarop++;
			hanap++;
		}
	}
	printf("%d %d\n",tarop,hanap);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:13: error: 'i' undeclared (first use in this function)
   11 |         for(i=0;i<turn;i++){
      |             ^
main.c:11:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:20: error: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
   13 |                 if(strcmp(taro[i],hanako[i])>0){
      |                    ^~~~~~
main.c:3:1: note: include '<string.h>' or provide a declaration of 'strcmp'
    2 | #include <stdlib.h>
  +++ |+#include <string.h>
    3 |
Language: C

#include<stdio.h>
int main(void)
{
  int n,i,j,t=0,h=0;

  scanf("%d",&n);

  for(i=0;i<n;i++){
    char st[100]={'\0'},sh[100]={'\0'};
    scanf("%s %s",&st,&sh);
    for(j=0;st[j]!='\0' && sh[j]!='\0';j++){
      if((int)st[j]>(int)sh[j])
        t+=3;  break;
      if((int)st[j]<(int)sh[j])
        h+=3;  break;
    }
    if(st[j]=='\0')
      h+=1;
    if(sh[j]=='\0')
      t+=1;
  }

  printf("%d %d\n",t,h);

Compiler output:
main.c: In function 'main':
main.c:23:3: error: expected declaration or statement at end of input
   23 |   printf("%d %d\n",t,h);
      |   ^~~~~~
Language: C++

#include <iostream>
#include <complex>
#include <cmath>
#include <vector>
#include <string>

#define P complex<double>
#define x real()
#define y imag()

using namespace std;

int main()
{
	int n, c1 = 0, c2 = 0;
	cin >> n;
	string str1, str2;
	while (n--) {
		cin >> str1 >> str2;
		switch (strcmp(str1.c_str(), str2.c_str())) {
			case -1:
			c2 += 3;
			break;
			case 0:
			c1++; c2++;
			break;
			case 1:
			c1 += 3;
			break;
			default:
			break;
		}
	}
	cout << c1 << " " << c2 << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:25: error: 'strcmp' was not declared in this scope
   20 |                 switch (strcmp(str1.c_str(), str2.c_str())) {
      |                         ^~~~~~
a.cc:5:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <vector>
  +++ |+#include <cstring>
    5 | #include <string>
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef long double ld;
typedef tuple<int, int> duo;

#define TT template<typename T>
#define ET(T) typename T::value_type
TT inline T sq(T x){return x*x;}
TT inline T In(){T x;cin>>x;return x;}
TT inline int ubnd(T&v,ET(T) x){return upper_bound(begin(v),end(v),x)-begin(v);}
TT inline int lbnd(T&v,ET(T) x){return lower_bound(begin(v),end(v),x)-begin(v);}
TT inline void sort(T&v){sort(begin(v),end(v));}
TT inline void revs(T&v){reverse(begin(v),end(v));}
TT inline void uniq(T&v){sort(v);v.erase(unique(begin(v),end(v)),end(v));}
TT inline void inpt(T&v,int n,function<ET(T)()>f=In<ET(T)>){for(v.reserve(n);n--;v.emplace_back(f()));}
TT inline void show(T&v,string d=" ",string e="\n"){int i=0;for(auto&x:v)i++&&(cout<<d),cout<<x;cout<<e;}
#undef TT
#undef ET

inline void fast_io(){ios::sync_with_stdio(0); cin.tie(0);}
inline int in(){int x;scanf("%d",&x);return x;}
inline string instr(){string x;cin>>x;return x;}
inline ll pow_mod(ll a, ll k, ll m){ll r=1;for(;k>0;a=a*a%m,k>>=1)if(k&1)r=r*a%m;return r;}
inline ll mod_inv(ll a, ll p){return pow_mod(a,p-2,p);}

const int dx[] = {0, 0, 1, -1, 1, 1, -1, -1};
const int dy[] = {1, -1, 0, 0, 1, -1, 1, -1};
const int Mod = 1000000000;

int main()
{
  int n = in();
  int taro, hanako;
  taro = hanako = 0;
  for (int i = 0; i < n; i++){
    string t, h;
    cin >> t >> h;
    if (t == h){
      t++;
      h++;
    }
    if (t > h) t += 3;
    if (h > t) h += 3;
  }
  cout << t << " " << h << endl;
  return (0);
}

// priority_queue queue deque front top push pop map set stringstream max_element min_element insert count find get tie make_tuple

Compiler output:
a.cc: In function 'int main()':
a.cc:41:8: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   41 |       t++;
      |       ~^~
a.cc:42:8: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   42 |       h++;
      |       ~^~
a.cc:47:11: error: 't' was not declared in this scope
   47 |   cout << t << " " << h << endl;
      |           ^
a.cc:47:23: error: 'h' was not declared in this scope
   47 |   cout << t << " " << h << endl;
      |                       ^
Language: C++

#include <stdio.h>

int main(void) {
	int n,i,c,k,t,len, po[2] = {0};
	char tar[100], han[100];
	
	scanf("%d", &n);
	
	for(i = 0; n > i; i++){
		scanf("%s%s", tar, han);
		len = strlen(tar);
		t = 0;
		for(c = 0; len > c; c++){
			if(han[c] == '\0') {t = 1; break;}
			if(tar[c] > han[c]){t = 1; break;}
			if(tar[c] < han[c]){t = 2; break;}
		}
		if(han[c] != '\0') {t = 2;}
		if(t == 1) po[1] += 3;
		if(t == 2) po[0] += 3;
		if(t == 0) {po[0]++; po[1]++;}
	}
	printf("%d %d\n", po[1], po[0]);
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: 'strlen' was not declared in this scope
   11 |                 len = strlen(tar);
      |                       ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <stdio.h>
  +++ |+#include <cstring>
    2 |