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

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
 
int main()
{
	int ncount = 0;		//初始化找到相同子串的次数为0
 int n;
	char *str1[50];
	scanf("%d\n%s",&n,str1);
	char str2[] = "ABC";
	do
	{
		str1 = strstr(str1, str2);			//调用strstr函数，若找到返回初次找到str2处的地址
		//如果str1 = "aaa12ssasa",str2 = "12",调用str1 = strstr(str1, str2)后str1 = "12ssasa"
		
			//输出调用strstr()后的str1
 
		if(str1 != NULL)					//如果str1不为空，即在str1中找到与str2相同的子串
		{
			ncount = ncount + 1;			//次数+1
			str1 = str1 + strlen(str2);		//str1指针指向后边的字符串（跳过n个位置（其中,str2长度 = n））
		}
		else
		{
			break;
		}
 
	}while (*str1 != '\0');					//指针未指向str1中的'\0'时，继续执行循环

	printf("%d\n", ncount);
	system("pause");
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:31: error: passing argument 1 of 'strstr' from incompatible pointer type [-Wincompatible-pointer-types]
   14 |                 str1 = strstr(str1, str2);                      //调用strstr函数，若找到返回初次找到str2处的地址
      |                               ^~~~
      |                               |
      |                               char **
In file included from main.c:3:
/usr/include/string.h:350:34: note: expected 'const char *' but argument is of type 'char **'
  350 | extern char *strstr (const char *__haystack, const char *__needle)
      |                      ~~~~~~~~~~~~^~~~~~~~~~
main.c:14:22: error: assignment to expression with array type
   14 |                 str1 = strstr(str1, str2);                      //调用strstr函数，若找到返回初次找到str2处的地址
      |                      ^
main.c:22:30: error: assignment to expression with array type
   22 |                         str1 = str1 + strlen(str2);             //str1指针指向后边的字符串（跳过n个位置（其中,str2长度 = n））
      |                              ^
main.c:29:23: warning: comparison between pointer and zero character constant [-Wpointer-compare]
   29 |         }while (*str1 != '\0');                                 //指针未指向str1中的'\0'时，继续执行循环
      |                       ^~
main.c:29:17: note: did you mean to dereference the pointer?
   29 |         }while (*str1 != '\0');                                 //指针未指向str1中的'\0'时，继续执行循环
      |                 ^
Language: Java

import java.util.*;
public class Main {
 
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
  int count=0;
		int s=sc.nextInt();
		String ss=sc.next();
    for(int i=0;i<s;i++){
if(ss.substring(i).equals(A)){if(ss.substring(i+1).equals(B)){if(ss.substring(i+2).equals(C)){count++;i+=2;}}}}
	System.out.print(count);
}
}

Compiler output:
Main.java:11: error: cannot find symbol
if(ss.substring(i).equals(A)){if(ss.substring(i+1).equals(B)){if(ss.substring(i+2).equals(C)){count++;i+=2;}}}}
                          ^
  symbol:   variable A
  location: class Main
Main.java:11: error: cannot find symbol
if(ss.substring(i).equals(A)){if(ss.substring(i+1).equals(B)){if(ss.substring(i+2).equals(C)){count++;i+=2;}}}}
                                                          ^
  symbol:   variable B
  location: class Main
Main.java:11: error: cannot find symbol
if(ss.substring(i).equals(A)){if(ss.substring(i+1).equals(B)){if(ss.substring(i+2).equals(C)){count++;i+=2;}}}}
                                                                                          ^
  symbol:   variable C
  location: class Main
3 errors
Language: Java

import java.util.Scanner;
 
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        String s = scan.nextLine();
        char[] cha=s.toCharArray();
        if (cha="A"){
            int res=0;
            res=res+1;
            System.out.println(res);
        }
    }
}

Compiler output:
Main.java:9: error: incompatible types: String cannot be converted to char[]
        if (cha="A"){
                ^
Main.java:9: error: incompatible types: char[] cannot be converted to boolean
        if (cha="A"){
               ^
2 errors
Language: Java

import java.util.*;
public class Main {
 
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
  int count=0;
		int s=sc.nextInt();
		String ss=sc.nextInt();
    for(int i=0;i<s;i++){
if(ss.substring(i).equals(A)){if(ss.substring(i+1).equals(B)){if(ss.substring(i+2).equals(C)){count++;i+=2;}}}}
	System.out.print(count);
}
}

Compiler output:
Main.java:9: error: incompatible types: int cannot be converted to String
		String ss=sc.nextInt();
		                    ^
Main.java:11: error: cannot find symbol
if(ss.substring(i).equals(A)){if(ss.substring(i+1).equals(B)){if(ss.substring(i+2).equals(C)){count++;i+=2;}}}}
                          ^
  symbol:   variable A
  location: class Main
Main.java:11: error: cannot find symbol
if(ss.substring(i).equals(A)){if(ss.substring(i+1).equals(B)){if(ss.substring(i+2).equals(C)){count++;i+=2;}}}}
                                                          ^
  symbol:   variable B
  location: class Main
Main.java:11: error: cannot find symbol
if(ss.substring(i).equals(A)){if(ss.substring(i+1).equals(B)){if(ss.substring(i+2).equals(C)){count++;i+=2;}}}}
                                                                                          ^
  symbol:   variable C
  location: class Main
4 errors
Language: Java

import java.util.*;
public class Main {
 
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
  int count=0;
		int s=sc.nextInt();
		String ss=sc.nextInt();
    for(int i=0;i<s;i++){if(ss.substring(i).equals(A){if(ss.substring(i+1).equals(B){if(ss.substring(i+2).equals(C){count++;i+=2;}}})}
	System.out.print(count);
}
}

Compiler output:
Main.java:10: error: ')' expected
    for(int i=0;i<s;i++){if(ss.substring(i).equals(A){if(ss.substring(i+1).equals(B){if(ss.substring(i+2).equals(C){count++;i+=2;}}})}
                                                     ^
Main.java:10: error: ')' expected
    for(int i=0;i<s;i++){if(ss.substring(i).equals(A){if(ss.substring(i+1).equals(B){if(ss.substring(i+2).equals(C){count++;i+=2;}}})}
                                                                                    ^
Main.java:10: error: ')' expected
    for(int i=0;i<s;i++){if(ss.substring(i).equals(A){if(ss.substring(i+1).equals(B){if(ss.substring(i+2).equals(C){count++;i+=2;}}})}
                                                                                                                   ^
Main.java:10: error: illegal start of expression
    for(int i=0;i<s;i++){if(ss.substring(i).equals(A){if(ss.substring(i+1).equals(B){if(ss.substring(i+2).equals(C){count++;i+=2;}}})}
                                                                                                                                    ^
4 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
  {
     int n,cnt=0;
     cin>>n;
     string s;
     for(int 1=0;1<n-2;i++)
     {
        if(s[i]=='A' and s[i+1]=='8' and s[i+2]=='c')
        {
          cnt++;
        }
     }
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: expected unqualified-id before numeric constant
    8 |      for(int 1=0;1<n-2;i++)
      |              ^
a.cc:8:13: error: expected ';' before numeric constant
    8 |      for(int 1=0;1<n-2;i++)
      |             ^~
      |             ;
a.cc:8:14: error: lvalue required as left operand of assignment
    8 |      for(int 1=0;1<n-2;i++)
      |              ^
a.cc:8:23: error: expected ')' before ';' token
    8 |      for(int 1=0;1<n-2;i++)
      |         ~             ^
      |                       )
a.cc:8:24: error: 'i' was not declared in this scope
    8 |      for(int 1=0;1<n-2;i++)
      |                        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,cnt=0;
  cin>>n;
  string s;
  cin>>s;
  for(int i=0;i<n-2;i++)
  {
    if(s[i]=="A" and s[i]=="B" and s[i]=="C")
    {
      cnt++;
    }
  }cout<<cnt;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(s[i]=="A" and s[i]=="B" and s[i]=="C")
a.cc:11:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(s[i]=="A" and s[i]=="B" and s[i]=="C")
a.cc:11:40: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(s[i]=="A" and s[i]=="B" and s[i]=="C")
Language: Java

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        String s = scan.nextLine();
        char[] cha=s.toCharArray();
        if (cha="ABC"){
            int res=0;
            res=res+1;
            System.out.println(res);
        }
    }
}

Compiler output:
Main.java:9: error: incompatible types: String cannot be converted to char[]
        if (cha="ABC"){
                ^
Main.java:9: error: incompatible types: char[] cannot be converted to boolean
        if (cha="ABC"){
               ^
2 errors
Language: C

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

int main()
{
    char a[51];
    int c=0,k=0,n;
    char *p=a;
    scanf("%d",&n);
    getchar();
    gets(a);
    while(*p!='\0')
    {
        if(*p=='A'&&k==0)
        {
            k++;p++;continue;
        }
        if(k==1&&*p!='B')
        {
            k=0;p++;continue;
        }
        if(k==1&&*p=='B')
        {
            k++;p++;continue;
        }


        if(k==2&&*p!='C')
        {
            k=0;p++;continue;
        }
        if(K==2&&*P=='C')
        {
            k==0;c++;
        }
         p++;
    }
    printf("%d",c);

    return 0;

Compiler output:
main.c: In function 'main':
main.c:11:5: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   11 |     gets(a);
      |     ^~~~
      |     fgets
main.c:32:12: error: 'K' undeclared (first use in this function)
   32 |         if(K==2&&*P=='C')
      |            ^
main.c:32:12: note: each undeclared identifier is reported only once for each function it appears in
main.c:32:19: error: 'P' undeclared (first use in this function)
   32 |         if(K==2&&*P=='C')
      |                   ^
main.c:40:5: error: expected declaration or statement at end of input
   40 |     return 0;
      |     ^~~~~~
Language: Java

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        String s = scan.nextLine();
        char[] ch=s.toCharArray();
        if (ch="ABC"){
            int res=0;
            res=res+1;
            System.out.println(res);
        }
    }
}

Compiler output:
Main.java:9: error: incompatible types: String cannot be converted to char[]
        if (ch="ABC"){
               ^
Main.java:9: error: incompatible types: char[] cannot be converted to boolean
        if (ch="ABC"){
              ^
2 errors
Language: C++

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

#define all(x) (x).begin(),(x).end()
#define rep(i,l,r) for(int i=(int)(l);i<(int)(r);i++)

typedef long long ll;
const ll MOD = 1e9 + 7;
const ll inf = 1LL<<60;
const double eps = 1e-9;



int main()
{
    int N, c = 0;
    string S;
    cin >> N >> S;
    for (int i = 0; i < N-4 i++) {
        if (S[i] == 'A' && S[i+1] == 'B' && S[i+2] == 'C') c++;
    }
    cout << c << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:19:28: error: expected ';' before 'i'
   19 |     for (int i = 0; i < N-4 i++) {
      |                            ^~
      |                            ;
Language: C

#include <stdio.h>

int main(void){
    int n,i,k,count;
    char c;
    scanf("%d",&n);
    gatchar();
    k=count=0;
    for(i=0;i<=n;i++){
        c=getchar();
        if(c=='A'&&k==0)
            k++;
        else if(c=='B'&&k==1)
            k++;
        else if(c=='C'&&k==2)
            k++;
        else
            k=0;
        if(k==3){
            count++;
            k=0;
        }
    }
    printf("%d",count);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:5: error: implicit declaration of function 'gatchar'; did you mean 'getchar'? [-Wimplicit-function-declaration]
    7 |     gatchar();
      |     ^~~~~~~
      |     getchar
Language: C++

#include<stdio.h>
#include<string.h>
int main(){
	int n,i,c=0;
	char a[100];
	scanf("%d",&n);
	getchar();
	gets(a);

	
	 
	for(i=0;i<n-2;i++){
		if(a[i]=='A'&&a[i+1]=='B'&&a[i+2]=='C')
		{
			c++;
		}
		
	
	}
	printf("%d",c);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
    8 |         gets(a);
      |         ^~~~
      |         getw
Language: C

#include<stdio.h>
int main()
{
	int N;
	char ch;
	int k,i;
	scanf("%d",&N);
    char s[N];
	for(i=0;i<n;i++){
		ch=getchar();
		s[i]=ch;
	}
	k=0;
	for(i=0;i<N;i++){
		if(s[i]=='A'&&s[i+1]=='B'&&s[i+2]=='C')k++;
	}
	printf("%d\n",k);
	return 0;
}

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

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

int main(){
  int n, c = 0;
  bool a = 0; b = 0;
  string s;
  cin >> n >> s;
  for(int i = 0; i < n; ++i){
    if(a && b){
      if(s[i] == 'C') ++c;
      a = 0;
      b = 0;
    }
    else if(a){
      if(s[i] == 'B') b = 1;
      else a = 0;
    }
    else if(s[i] == 'A') a = 1;
    else{
      a = 0;
      b = 0;
    }
  }
  cout << c << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:15: error: 'b' was not declared in this scope
    6 |   bool a = 0; b = 0;
      |               ^
Language: Java

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        String s = scan.nextLine();
        if (s == "ABC"){
           int res = 0;
           int res=res+1;
            System.out.println(res);
        }
    }
}

Compiler output:
Main.java:10: error: variable res is already defined in method main(String[])
           int res=res+1;
               ^
1 error
Language: C++

#include <iostream>
#include <string>
int main()
{
  int n,c;
	c = 0;
	string s;
	cin >> n >> s;
	for (int i = 0; i < n - 2; i++) {
		if (s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C')	c++;
	}
	cout << c << endl;
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'string' was not declared in this scope
    7 |         string s;
      |         ^~~~~~
a.cc:7:9: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:8:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |         cin >> n >> s;
      |         ^~~
      |         std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:8:21: error: 's' was not declared in this scope
    8 |         cin >> n >> s;
      |                     ^
a.cc:12:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |         cout << c << endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:12:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   12 |         cout << c << endl;
      |                      ^~~~
      |                      std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<stdio.h>
int main()
{
	int n;
	scanf("%d",&n);
	char str[100],a1[2]="A",s2[2]="B",s3[2]="C";
	scanf("%s",str);
	int count=0;
	for(int i=0;i<n-2;i++)
	{
		if(str[i]==a1[0])
			if[str[i+1]==s2[0]]
				if(str[i+1]==s3[0])
					count++;
	}
	printf("%d\n",count);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:27: error: expected '(' before '[' token
   12 |                         if[str[i+1]==s2[0]]
      |                           ^
      |                           (
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args ){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    String S = sc.next();
    int count =0;
    
   S = replace("ABC","");
    count = (N - S.length())/3;
    System.out.println(count);
}
}

Compiler output:
Main.java:10: error: cannot find symbol
   S = replace("ABC","");
       ^
  symbol:   method replace(String,String)
  location: class Main
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll MAX=1e5+5;
ll mod=1e9+7;
#define pb push_back
#define se second
#define fi first
#define maxe max_element
#define mine min_element
#define debug(x) cout<<#x<<" :: "<<x<<endl;
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<endl;
#define debug3(x,y,z) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<endl;
#define debug4(x,y,z,w) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<"\t"<<#w<<" :: "<<w<<endl;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define boost  ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
vector<int> graph[205];
int color[205];
int nCk[100][100];
bool bipartite_jugding(int v, int c){
    color[v] = c;
    for(int i = 0; i < graph[v].size(); ++i){
        if(color[graph[v][i]] == c) return false;
        if(color[graph[v][i]] == 0 && !bipartite_jugding(graph[v][i], -c)){
            return false;
        }
    }
    return true;
}

 void combi() {
	for (int i = 0; i <= 99; ++i) nCk[i][0] = 1;
	for (int i = 1; i <= 99; ++i) for (int j = 1; j <= i; ++j) {
		nCk[i][j] = (nCk[i-1][j] + nCk[i-1][j-1]) % mod;
	}
}

long long expo(ll x,ll n,ll M)
{
    if(n==0)
        return 1;
    else if(n%2 == 0)        //n is even
        return expo((x*x)%M,n/2,M);
    else                             //n is odd
        return (x*expo((x*x)%M,(n-1)/2,M))%M;

}

void solve(){
  int n;
  string s;
  cin>>n>>s;ll ans=0;
  for(int i=0;i<(n-2);i++)
  {
      string ss=s.substr(i,3);
      if(ss10
ZABCDBABCQ10
ZABCDBABCQ=="ABC")
        ans++;
  }cout<<ans;
}

int main(){
boost;
  solve();
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:58:10: error: 'ss10' was not declared in this scope; did you mean 'ss'?
   58 |       if(ss10
      |          ^~~~
      |          ss
a.cc:58:14: error: expected ')' before 'ZABCDBABCQ10'
   58 |       if(ss10
      |         ~    ^
      |              )
   59 | ZABCDBABCQ10
      | ~~~~~~~~~~~~
Language: C++

#include<stdio.h>
#include<string.h>
int main(){
	int n,i,c=0;
	char a[100];
	scanf("%d",&n);
	getchar();
	gets(a);

	
	 
	for(i=0;i<n-2;i++){
		if(a[i]=='A')
		{
			if(a[i+1]=='B'){
				if(a[i+2]=='C'){
					c++;
				}
			}
			
		}
	
	}
	printf("%d",c);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
    8 |         gets(a);
      |         ^~~~
      |         getw
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  
  int n;
  string s;
  cin >> n >> s;

  int ans = 0;

    for (int i = 0; i < n; i++) {
    
    if(s.at(i) == 'A') {
      i++;
    if(s.at(i) == 'B') {
      i++;
    if(s.at(i) == 'C') {
      ans++; 
    else if(s.at(i) == 'A') {
      i--; continue;     
    }
    }
    }
    }
   }
      cout << ans << endl;
  }       

Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: expected '}' before 'else'
   21 |     else if(s.at(i) == 'A') {
      |     ^~~~
a.cc:19:24: note: to match this '{'
   19 |     if(s.at(i) == 'C') {
      |                        ^
a.cc: At global scope:
a.cc:28:7: error: 'cout' does not name a type
   28 |       cout << ans << endl;
      |       ^~~~
a.cc:29:3: error: expected declaration before '}' token
   29 |   }
      |   ^
Language: Java

import java.util.*;
public class task2 {
    public static void main(String args[]) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        String S = s.next();
        String a = "ABC";
        String[] arr = S.split(a);
        System.out.println(arr.length-1);
    }
}

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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  
  int j;
  
  j = 0;
  
  for (int i = 0; i < N-2; i++){
    if (S.at(i) == a){
      if (S.at(i + 1) == b){
        if (S.at(i + 2) == c){
          j = j + 1;
        }
      }
    }
  }
  
  cout << j << endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:20: error: 'a' was not declared in this scope
   15 |     if (S.at(i) == a){
      |                    ^
a.cc:16:26: error: 'b' was not declared in this scope
   16 |       if (S.at(i + 1) == b){
      |                          ^
a.cc:17:28: error: 'c' was not declared in this scope
   17 |         if (S.at(i + 2) == c){
      |                            ^
Language: C++

#include<stdio.h>
#include<string.h>
int main()
{
  char a[52];
  int n,i,p=0;
  scanf("%d",&n);
  gets(a);
  for(i=0;i<n;i++)
  {
    if(a[i]=='A')
    {
      if(a[i+1]=='B')
      {
        if(a[i+2]=='C')
          p++;
      }
    }
  }
  printf("%d",p);
  return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'gets' was not declared in this scope; did you mean 'getw'?
    8 |   gets(a);
      |   ^~~~
      |   getw
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  
  int j;
  
  j = 0;
  
  for (int i = 0; i < N-2; i++){
    if (S.at(i) == "a"){
      if (S.at(i + 1) == "b"){
        if (S.at(i + 2) == "c"){
          j = j + 1;
        };
      };
    };
  }
  
  cout << j << endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |     if (S.at(i) == "a"){
      |         ~~~~~~~~^~~~~~
a.cc:16:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |       if (S.at(i + 1) == "b"){
      |           ~~~~~~~~~~~~^~~~~~
a.cc:17:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |         if (S.at(i + 2) == "c"){
      |             ~~~~~~~~~~~~^~~~~~
Language: C

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

int main()
{
    char a[51];
    int c=0,k=0,n;
    char *p=a;
    scanf("%d",&n);
    getchar();
    gets(a);
    while(*p!='\0')
    {
        if(*p=='A'&&k==0)
        {
            k++;p++;continue;
        }
        if(k==1&&*p!='B')
        {
            k=0;p++;continue;
        }
        if(k==1&&*p=='B')
        {
            k++;p++;continue;
        }


        if(k==2&&*p!='C')
        {
            k=0;p++;continue;
        }
        if(K==2&&*P=='C')
        {
            k++;
        }
        if(k==3){k=0;c++;}

        p++;
    }
    printf("%d",c);

    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:11:5: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   11 |     gets(a);
      |     ^~~~
      |     fgets
main.c:32:12: error: 'K' undeclared (first use in this function)
   32 |         if(K==2&&*P=='C')
      |            ^
main.c:32:12: note: each undeclared identifier is reported only once for each function it appears in
main.c:32:19: error: 'P' undeclared (first use in this function)
   32 |         if(K==2&&*P=='C')
      |                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  
  int j;
  
  j = 0;
  
  for (int i = 0; i < N-2; i++){
    if (S.at(i) == "a"){
      if (S.at(i + 1) == "b"){
        if (S.at(i + 2) == "c"){
          j = j + 1;
        }
      }
    }
  }
  
  cout << j << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |     if (S.at(i) == "a"){
      |         ~~~~~~~~^~~~~~
a.cc:16:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |       if (S.at(i + 1) == "b"){
      |           ~~~~~~~~~~~~^~~~~~
a.cc:17:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |         if (S.at(i + 2) == "c"){
      |             ~~~~~~~~~~~~^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  
  int n;
  string s;
  cin >> n >> s;

  int ans = 0;

    for (int i = 0; i < n; i++) {
    
    if(s.at(i) == 'A') {
      i++;
    if(s.at(i) == 'B') {
      i++;
    if(s.at(i) == 'C') {
      ans++; 
    else {
      i--;
    }
    }
    }
    }
   }
      cout << ans << endl;
  }       

Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: expected '}' before 'else'
   21 |     else {
      |     ^~~~
a.cc:19:24: note: to match this '{'
   19 |     if(s.at(i) == 'C') {
      |                        ^
a.cc: At global scope:
a.cc:28:7: error: 'cout' does not name a type
   28 |       cout << ans << endl;
      |       ^~~~
a.cc:29:3: error: expected declaration before '}' token
   29 |   }
      |   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  
  int j;
  
  j = 0;
  
  for (int i = 0; i < N-2; i++){
    if (S.at(i) == "a"){
      if (S.at(i + 1) == "b"){
        if (S.at(i + 2) == "c"){
          j = j + 1;
        }
      }
    }
  }
  
  cout << j << endl;
          
    

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |     if (S.at(i) == "a"){
      |         ~~~~~~~~^~~~~~
a.cc:16:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |       if (S.at(i + 1) == "b"){
      |           ~~~~~~~~~~~~^~~~~~
a.cc:17:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |         if (S.at(i + 2) == "c"){
      |             ~~~~~~~~~~~~^~~~~~
a.cc:24:21: error: expected '}' at end of input
   24 |   cout << j << endl;
      |                     ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include<bits/stdc++.h>
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
#define watch(x) cout<<(#x)<<" is "<<x<<endl;
#define ll long long int
#define pb push_back
#define in insert
#define mp make_pair
#define F first
#define S second
#define N 1000000
#define MOD 1000000007
#define PI acos(-1)
int main()
{
	IOS
	int n;
	cin>>n;
	string s;
	cin>>s;
	int c=0;
	for(i=0;i<n-2;i++)
	{
		if(s[i]=='A'&&s[i]=='B'&&s[i]=='C')
		c++;
	}
	cout<<c;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:13: error: 'i' was not declared in this scope
   22 |         for(i=0;i<n-2;i++)
      |             ^
Language: C++

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

int occur(char *str,
                    string word)
{
    char *p;

    // split the string by spaces in a 
    vector<string> a;

    p = strtok(str, " ");
    while (p != NULL)
    {
        a.push_back(p);
        p = strtok(NULL, " ");
    }

    // search for pattern in a 
    int c = 0;
    for (int i = 0; i < a.size(); i++)

        // if match found increase count 
        if (word == a[i])
            c++;
    return c;
}


int main(){

int x;
string letter="ABC";

cin>>x;
char s[x];

cin>>s;

int cou = occur(s,letter);
cout<<cou<<endl;
}

Compiler output:
a.cc: In function 'int occur(char*, std::string)':
a.cc:13:9: error: 'strtok' was not declared in this scope; did you mean 'strtoq'?
   13 |     p = strtok(str, " ");
      |         ^~~~~~
      |         strtoq
Language: C

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

int main()
{
    char a[51];
    int c=0,k=0,n;
    char *p=a;
    scanf("%d",&n);
    getchar();
    gets(a);
    while(*p!='\0')
    {
        if(k==0&&*p=='A')
        {
            k++;p++;continue;
        }
        if(k==1&&*p!='B')
        {
            k=0;p++;continue;
        }
        if(k==1&&*p=='B')
        {
            k++;p++;continue;
        }


        if(k==2&&*p!='C')
        {
            k=0;p++;continue;
        }
        if(K==2&&*P=='C')
        {
            k++;
        }
        if(k==3){k=0;c++;}

        p++;
    }
    printf("%d",c);

    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:11:5: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   11 |     gets(a);
      |     ^~~~
      |     fgets
main.c:32:12: error: 'K' undeclared (first use in this function)
   32 |         if(K==2&&*P=='C')
      |            ^
main.c:32:12: note: each undeclared identifier is reported only once for each function it appears in
main.c:32:19: error: 'P' undeclared (first use in this function)
   32 |         if(K==2&&*P=='C')
      |                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  
  int n;
  string s;
  cin >> n >> s;

  int ans = 0;

    for (int i = 0; i < n; i++) {
    
    if(s.at(i) == 'A') {
      i++;
    if(s.at(i) == 'B') {
      i++;
    if(s.at(i) == 'C') {
      ans++; 
    else {i--;}
    }
    }
    }
   }
      cout << ans << endl;
  }       

Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: expected '}' before 'else'
   21 |     else {i--;}
      |     ^~~~
a.cc:19:24: note: to match this '{'
   19 |     if(s.at(i) == 'C') {
      |                        ^
a.cc: At global scope:
a.cc:26:7: error: 'cout' does not name a type
   26 |       cout << ans << endl;
      |       ^~~~
a.cc:27:3: error: expected declaration before '}' token
   27 |   }
      |   ^
Language: C

char* substr(const char *src, int m, int n)
{
	// get length of the destination string
	int len = n - m;

	// allocate (len + 1) chars for destination (+1 for extra null character)
	char *dest = (char*)malloc(sizeof(char) * (len + 1));

	// extracts characters between m'th and n'th index from source string
	// and copy them into the destination string
	for (int i = m; i < n && (*src != '\0'); i++)
	{
		*dest = *(src + i);
		dest++;
	}

	// null-terminate the destination string
	*dest = '\0';

	// return the destination string
	return dest - len;
}

Compiler output:
main.c: In function 'substr':
main.c:7:29: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
    7 |         char *dest = (char*)malloc(sizeof(char) * (len + 1));
      |                             ^~~~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
  +++ |+#include <stdlib.h>
    1 | char* substr(const char *src, int m, int n)
main.c:7:29: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
    7 |         char *dest = (char*)malloc(sizeof(char) * (len + 1));
      |                             ^~~~~~
main.c:7:29: note: include '<stdlib.h>' or provide a declaration of 'malloc'
Language: C++

#include<stdio.h>
int main()
{
	int N,i,x,num=0;
	scanf("%d\n",&N);
	if(N>=3&&N<=50)
	{
	char S[N];
	gets(S);
	for(i=0;i<N-2;i++)
	{
		if(S[i]=='A'&&S[i+1]=='B'&&S[i+2]=='C')
		num++;
	}
	printf("%d",num);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
    9 |         gets(S);
      |         ^~~~
      |         getw
Language: C++

//
//  main.cpp
//  A
//
//  Created by 耿英俊 on 2020/1/10.
//  Copyright © 2020 耿英俊. All rights reserved.
//
#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <string.h>
#include <stdio.h>
#include <cstring.h>
using namespace std;
int main(int argc, const char * argv[]) {
    int m;
    cin>>m;
    char t[4];
    gets(t);
    string N;
    getline(cin,N);
    char n[m];
    strcpy(n,N.c_str());
    int flag=0;
    for(int i=0;i<m;i++){
        if(n[i]=='A')
            if(n[i+1]=='B')
                if(n[i+2]=='C')
                    flag++;
    }
    cout<<flag;
}


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

#include <stdio.h>
int main()
{
    char a[50];
    int n,court=0;
    scanf("%d",&n);
    getchar();
    gets(a);
    for(int i=0;i<50;i++)
    {
        if(a[i]=='A')
            if(a[i+1]=='B')
            if(a[i+2]=='C')
            court++;
    }
    printf("%d\n",court);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    8 |     gets(a);
      |     ^~~~
      |     getw
Language: C++

#include<stdio.h>
#include<string.h>
int main()
{
	int n,i,m=0;
	scanf("%d",&n);
    char a[100];
    getchar();
    gets(a);
    for(i=0;i<n-2;i++)
    {
    	if(a[i]=='A'&&a[i+1]=='B'&&a[i+2]=='C')
    	m=m+1;
	}
	printf("%d",m);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    9 |     gets(a);
      |     ^~~~
      |     getw
Language: C++

//
//  main.cpp
//  A
//
//  Created by 耿英俊 on 2020/1/10.
//  Copyright © 2020 耿英俊. All rights reserved.
//
#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <string.h>
#include <stdio.h>
using namespace std;
int main(int argc, const char * argv[]) {
    int m;
    cin>>m;
    char t[4];
    gets(t);
    string N;
    getline(cin,N);
    char n[m];
    strcpy(n,N.c_str());
    int flag=0;
    for(int i=0;i<m;i++){
        if(n[i]=='A')
            if(n[i+1]=='B')
                if(n[i+2]=='C')
                    flag++;
    }
    cout<<flag;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:18:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
   18 |     gets(t);
      |     ^~~~
      |     getw
Language: C++

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

#define FOR(n) for(int i=0;i<n;i++)
#define ll long long

ll mob=1000000007;

using namespace std;
int main()
{ int n;
 cin>>n;
 char a[51];int k=0;
 FOR(N-2)
 {if(a[i]=='A'&&a[i+1]=='B'&&a[i+2]=='C') k++;
   else continue;
 
 }
cout<<k;




return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:14:6: error: 'N' was not declared in this scope
   14 |  FOR(N-2)
      |      ^
a.cc:4:30: note: in definition of macro 'FOR'
    4 | #define FOR(n) for(int i=0;i<n;i++)
      |                              ^
Language: C++

#include <iostream>
using namespace std;
 
int main() {
  string N, S;
  cin >> N >> S;
 
 
  int count = 0;
  for (int i = 0; i < S.size(); i++) {
    if (S.at(i) == "abc") {
      count++;
      cout << count << endl;
    }
  }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if (S.at(i) == "abc") {
      |         ~~~~~~~~^~~~~~~~
Language: C++

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

typedef struct{
  int num;
  char *S;
}strct;

int main(void){
 int N;
 char *adr
 strct *entity;
 entity=(strct*)malloc(sizeof(strct));

 entity->num=0;
 entity->S=(char*)malloc(sizeof(char)*N);

 sprintf(entity->S,"%s",str);
 scanf("%s",&str);
 printf("%s¥n",entity->str);

 free(entity->str);
 free(entity);


 adr=strstr(S,"ABC");

return 0;


 }

Compiler output:
a.cc: In function 'int main()':
a.cc:13:2: error: expected initializer before 'strct'
   13 |  strct *entity;
      |  ^~~~~
a.cc:14:2: error: 'entity' was not declared in this scope
   14 |  entity=(strct*)malloc(sizeof(strct));
      |  ^~~~~~
a.cc:19:25: error: 'str' was not declared in this scope; did you mean 'std'?
   19 |  sprintf(entity->S,"%s",str);
      |                         ^~~
      |                         std
a.cc:27:2: error: 'adr' was not declared in this scope
   27 |  adr=strstr(S,"ABC");
      |  ^~~
a.cc:27:13: error: 'S' was not declared in this scope
   27 |  adr=strstr(S,"ABC");
      |             ^
Language: C++

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

int main() {
    int N;
    string S;
    cin >> N >> S;
    int count =0;
    for (int i=0; i<N; i+=3) {
        if (S[i] == "ABC") {
            cout ++;
        }
    }
    cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |         if (S[i] == "ABC") {
a.cc:12:18: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   12 |             cout ++;
      |             ~~~~~^~
Language: C

#include <stdio.h>

int main(void){

    int n, count=0;

    scanf("%d", &n);

    char s[n+2];

    scanf("%s", &s);

    for(int i=0;i<n+1;i++){
        if(s[i]=='A'){
            i++;
            if(s[i]=='B'){
                i++;
                if(s[i]=='C'){
                    count++;
                }
            }
    }

    printf("%d", count);
}

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

#include<bits/stdc++.h>

using namespace std;

int main() {
 int n, ctr = 0;
  cin>>n;
  string str, sam = "ABC";
  cin>>str;
  for(int i = 0;  i < str.length() - 3; i++) {
  	if(sam = str.substr(i, 3))
      ctr++;
  }
  cout<<ctr;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: could not convert 'sam.std::__cxx11::basic_string<char>::operator=(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int](((std::__cxx11::basic_string<char>::size_type)i), 3))' from 'std::__cxx11::basic_string<char>' to 'bool'
   11 |         if(sam = str.substr(i, 3))
      |            ~~~~^~~~~~~~~~~~~~~~~~
      |                |
      |                std::__cxx11::basic_string<char>
Language: C++

#include <iostream>
#include <bits/stdc++.h>
#include <vector>
#include <string>
#include <math.h>
#define rep(i, n) for (int i=0;i<n;i++);
using namespace std;
typedef long long ll;

int main(){
    cin.tie(0); cout.tie(0);
    ios::sync_with_stdio(false);

    int N;
    cin >> N;
    string S[N];
    for(int i=0;i<N;i++) cin >> S[i];

    int res = count(S.begin(), S.end(), "ABC");
    cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:23: error: request for member 'begin' in 'S', which is of non-class type 'std::string [N]' {aka 'std::__cxx11::basic_string<char> [N]'}
   19 |     int res = count(S.begin(), S.end(), "ABC");
      |                       ^~~~~
a.cc:19:34: error: request for member 'end' in 'S', which is of non-class type 'std::string [N]' {aka 'std::__cxx11::basic_string<char> [N]'}
   19 |     int res = count(S.begin(), S.end(), "ABC");
      |                                  ^~~
Language: C++

//
//  main.cpp
//  A
//
//  Created by 耿英俊 on 2020/1/10.
//  Copyright © 2020 耿英俊. All rights reserved.
//
#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <string.h>
using namespace std;
int main(int argc, const char * argv[]) {
    int m;
    cin>>m;
    char t[4];
    gets(t);
    string N;
    getline(cin,N);
    char n[m];
    strcpy(n,N.c_str());
    int flag=0;
    for(int i=0;i<m;i++){
        if(n[i]=='A')
            if(n[i+1]=='B')
                if(n[i+2]=='C')
                    flag++;
    }
    cout<<flag;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:17:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
   17 |     gets(t);
      |     ^~~~
      |     getw
Language: C++

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

int main()
{
    char S[];
    cin >> S;
    vector<char> v(S, S + sizeof(S));
    cout << count(v.begin(), v.end(), 'ABC');

    getchar();
    return 0;
}

Compiler output:
a.cc:12:39: warning: multi-character character constant [-Wmultichar]
   12 |     cout << count(v.begin(), v.end(), 'ABC');
      |                                       ^~~~~
a.cc: In function 'int main()':
a.cc:9:10: error: storage size of 'S' isn't known
    9 |     char S[];
      |          ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  string s;
  cin>>s;
  int a = count(s.begin(),s.end(),"ABC");
  cout<<a<<endl;
}

Compiler output:
In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_equals_val<_Value>::operator()(_Iterator) [with _Iterator = __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >; _Value = const char [4]]':
/usr/include/c++/14/bits/stl_algobase.h:2163:12:   required from 'typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::__count_if(_InputIterator, _InputIterator, _Predicate) [with _InputIterator = __gnu_cxx::__normal_iterator<char*, __cxx11::basic_string<char> >; _Predicate = __gnu_cxx::__ops::_Iter_equals_val<const char [4]>; typename iterator_traits< <template-parameter-1-1> >::difference_type = long int]'
 2163 |         if (__pred(__first))
      |             ~~~~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4033:29:   required from 'typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&) [with _IIter = __gnu_cxx::__normal_iterator<char*, __cxx11::basic_string<char> >; _Tp = char [4]; typename iterator_traits< <template-parameter-1-1> >::difference_type = long int]'
 4033 |       return std::__count_if(__first, __last,
      |              ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
 4034 |                              __gnu_cxx::__ops::__iter_equals_val(__value));
      |                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:9:16:   required from here
    9 |   int a = count(s.begin(),s.end(),"ABC");
      |           ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/predefined_ops.h:270:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
  270 |         { return *__it == _M_value; }
      |                  ~~~~~~^~~~~~~~~~~
Language: Java

import java.util.Scanner;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        sc.nextLine();
        char[] S = sc.nextLine().toCharArray();
        int cnt = 0;
        for (int i=0; i+2<S.length; i++) {
            if (S[i] == 'A' && S[i+1] == 'B' && S[i+2] == 'C') cnt++;
        }
        System.out.println(cnt);
}


Compiler output:
Main.java:3: 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)
1 error
Language: C++

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

int main()
{
  long x,i,sum,h,c;
  sum=0;
  h=0;
  string ans="ABC";
  string v;
  cin >> x;  
  char s[x];
  for(i=0;i<x;i++)
  {
    cin >>s[i];
  }
  for(i=0;i<(x-2);i++)
  {
    v=s[i]+s[i+1]+s[i+2];
    if(equal(s.begin(), s.end(), v.begin(), v.begin() + 3))
    {
      sum=sum+1;
    }
    
  }
  
  cout << sum <<endl;
  
  return 0;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:16: error: request for member 'begin' in 's', which is of non-class type 'char [x]'
   20 |     if(equal(s.begin(), s.end(), v.begin(), v.begin() + 3))
      |                ^~~~~
a.cc:20:27: error: request for member 'end' in 's', which is of non-class type 'char [x]'
   20 |     if(equal(s.begin(), s.end(), v.begin(), v.begin() + 3))
      |                           ^~~
Language: C++

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
    char a[60],b[4]="ABC";
    int k=0,i,j;
    gets(a);
    for(i=0;i<strlen(a);i++)
      {
           for(j=0;j<3;j++)
            if(b[j]!=a[i+j])
                break;
        if(j==3)
            k++;
      }
    printf("%d",k);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    8 |     gets(a);
      |     ^~~~
      |     getw
Language: C++

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
    char a[60],b[4]="ABC";
    int k=0,i,j;
    gets(a);
    for(i=0;i<strlen(a);i++)
      {  for(j=0;j<3;j++)
            if(b[j]!=a[i+j])
                break;
        if(j==4)
            k++;
      }
    printf("%d",k);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    8 |     gets(a);
      |     ^~~~
      |     getw
Language: C++

,----------[,----------]
>>>>
,----------------------------------------------------------------->
,----------------------------------------------------------------->
,----------------------------------------------------------------->
>>+
<<<--[>>+>[-]<<<-]++>>[<<+>>-] /* isC */
<<<-[>>>+>[-]<<<<-]+>>>[<<<+>>>-] /* isB */
<<<<[>>>>+>[-]<<<<<-]>>>>[<<<<+>>>>-] /* isA */
>[>+<-]<<
,----------[------------------------------------------------------->
>>[>+<-]+
<<<--[>>+>[-]<<<-]++>>[<<+>>-] /* isC */
<<<-[>>>+>[-]<<<<-]+>>>[<<<+>>>-] /* isB */
<<<<[>>>>+>[-]<<<<<-]>>>>[<<<<+>>>>-] /* isA */
>[>+<-]<<
,----------]
<[-]>+>+>++++++++++[[->]>>+<<<<<[<]>>>]>>+>[<->[-]]<[++++++++++++++++++++++++++++++++++++++++++++++++.[-]>>[-]<<<[>>>+<<<-]>]>>++++++++++++++++++++++++++++++++++++++++++++++++.


Compiler output:
a.cc:1:1: error: expected unqualified-id before ',' token
    1 | ,----------[,----------]
      | ^
a.cc:1:2: error: expected unqualified-id before '--' token
    1 | ,----------[,----------]
      |  ^~
Language: C++

#include<stdio.h>
int  main()
{
  int n,b=0,i;
  char a[];
  scanf("%d",&n);
  gets(a);
  for(i=0;i<n;i++)
  {
    if(a[i]=='a'&&a[i+1]=='b'&&a[i+2]=='c')
      b++;
  }
  printf("%d",b);
  return 0;
}
      
  

Compiler output:
a.cc: In function 'int main()':
a.cc:5:8: error: storage size of 'a' isn't known
    5 |   char a[];
      |        ^
a.cc:7:3: error: 'gets' was not declared in this scope; did you mean 'getw'?
    7 |   gets(a);
      |   ^~~~
      |   getw
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 文字数の入力
		int N = sc.nextInt();
		// 文字列の入力
		String S = sc.next();
        int count = 0; 
        
		
		// replaceでABCを抜く
		S = S.replace("ABC","");
        count = ( N - S.length )/3; 
        System.out.println(count);
	}
}

Compiler output:
Main.java:14: error: cannot find symbol
        count = ( N - S.length )/3; 
                       ^
  symbol:   variable length
  location: variable S of type String
1 error