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

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

int main() {
  int n;
  string s;
  cin >> n >> s;
  int count;
  for (int i = 0; i<n-2; i++) {
    if (s.at(i) + s.at(i+1) + s.at(i+2) == "ABC") {
      count++;
    }
  }
  cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:41: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |     if (s.at(i) + s.at(i+1) + s.at(i+2) == "ABC") {
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Language: C++

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

typedef long long int ll;
typedef pair<ll, ll> p_ll;
typedef vector<pair<ll, ll>> vec_p; //vector<pair<ll, ll>> pairs(n) ,pairs.at(i) = make_pair(i*i, i)

#define ture ture
#define flase false
#define falg flag

#define REP(i, x) for (ll i = 0; i < (ll)(x); i++)
#define REPS(i, x) for (ll i = 1; i <= (ll)(x); i++)
#define RREP(i, x) for (ll i = ((ll)(x)-1); i >= 0; i--)
#define RREPS(i, x) for (ll i = ((ll)(x)); i > 0; i--)
#define all(x) (x).begin(), (x).end()

const ll MOD = pow(10, 9) + 7;
const ll LLINF = pow(2, 61) - 1;//llの最大9*10^18
const int INF = pow(2, 30) - 1;

ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }

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

    ll N,ans=0;
    string S;
    cin >> N>>S;

    REP(i,N-2){
      if(S[i]==‘A‘&&S[i+1]==‘B‘&&S[i+2]==‘C‘){
      ans++;
      }
    }
  cout<<ans<<endl;
}


Compiler output:
a.cc:34:16: error: extended character ‘ is not valid in an identifier
   34 |       if(S[i]==‘A‘&&S[i+1]==‘B‘&&S[i+2]==‘C‘){
      |                ^
a.cc:34:16: error: extended character ‘ is not valid in an identifier
a.cc:34:29: error: extended character ‘ is not valid in an identifier
   34 |       if(S[i]==‘A‘&&S[i+1]==‘B‘&&S[i+2]==‘C‘){
      |                             ^
a.cc:34:29: error: extended character ‘ is not valid in an identifier
a.cc:34:42: error: extended character ‘ is not valid in an identifier
   34 |       if(S[i]==‘A‘&&S[i+1]==‘B‘&&S[i+2]==‘C‘){
      |                                          ^
a.cc:34:42: error: extended character ‘ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:34:16: error: '\U00002018A\U00002018' was not declared in this scope
   34 |       if(S[i]==‘A‘&&S[i+1]==‘B‘&&S[i+2]==‘C‘){
      |                ^~~
a.cc:34:29: error: '\U00002018B\U00002018' was not declared in this scope
   34 |       if(S[i]==‘A‘&&S[i+1]==‘B‘&&S[i+2]==‘C‘){
      |                             ^~~
a.cc:34:42: error: '\U00002018C\U00002018' was not declared in this scope
   34 |       if(S[i]==‘A‘&&S[i+1]==‘B‘&&S[i+2]==‘C‘){
      |                                          ^~~
Language: C++

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

int main() {
  int A;
  cin >> A;
  int B = A - 2;
  string S;
  cin >> S;
  int count = 0;
  rep(i,B){
    int n = i + 1;
    int m = i + 2;
    if(S[i] == "A" && S[n] == "B" && S[m] == "C"){
       count++;
       }
       }
       cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |     if(S[i] == "A" && S[n] == "B" && S[m] == "C"){
a.cc:15:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |     if(S[i] == "A" && S[n] == "B" && S[m] == "C"){
a.cc:15:43: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |     if(S[i] == "A" && S[n] == "B" && S[m] == "C"){
Language: C++

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

int main() {
  int A;
  cin >> A;
  int B = A - 2;
  string S;
  cin >> S;
  int count = 0;
  rep(i,B){
    int n = i + 1;
    int m = i + 2;
    if(S[i] == "A" && S[n] == "B" && S[m] == "C){
       count++;
       }
       }
       cout << count << endl;
}


Compiler output:
a.cc:15:46: warning: missing terminating " character
   15 |     if(S[i] == "A" && S[n] == "B" && S[m] == "C){
      |                                              ^
a.cc:15:46: error: missing terminating " character
   15 |     if(S[i] == "A" && S[n] == "B" && S[m] == "C){
      |                                              ^~~~
a.cc: In function 'int main()':
a.cc:15:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |     if(S[i] == "A" && S[n] == "B" && S[m] == "C){
a.cc:15:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |     if(S[i] == "A" && S[n] == "B" && S[m] == "C){
a.cc:17:8: error: expected primary-expression before '}' token
   17 |        }
      |        ^
a.cc:16:16: error: expected ')' before '}' token
   16 |        count++;
      |                ^
      |                )
   17 |        }
      |        ~        
a.cc:15:7: note: to match this '('
   15 |     if(S[i] == "A" && S[n] == "B" && S[m] == "C){
      |       ^
a.cc:17:8: error: expected primary-expression before '}' token
   17 |        }
      |        ^
a.cc: At global scope:
a.cc:19:8: error: 'cout' does not name a type
   19 |        cout << count << endl;
      |        ^~~~
a.cc:20:1: error: expected declaration before '}' token
   20 | }
      | ^
Language: C++

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


int solve(int &n)
{
  int N = *n;
  int count=0;
  string S;
  cin >> S;
  for(int i=0; i<N; i++)
  {
    if(S[i] == 'A' && S[i+1] == 'B' && S[i+2] == 'C')
    {
      count++;
    }
  }
  cout << count << endl;
}
  
int main()
{
  int N;
  cin >> N;
  solve(N);
  return 0;
}
  

Compiler output:
a.cc: In function 'int solve(int&)':
a.cc:7:11: error: invalid type argument of unary '*' (have 'int')
    7 |   int N = *n;
      |           ^~
a.cc:19:1: warning: no return statement in function returning non-void [-Wreturn-type]
   19 | }
      | ^
Language: C++

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


int solve(int *n)
{
  int N = *n;
  int count=0;
  string S;
  cin >> S;
  for(int i=0; i<N; i++)
  {
    if(S[i] == 'A' && S[i+1] == 'B' && S[i+2] == 'C')
    {
      count++;
    }
  }
  cout << count << endl;
}
  
int main()
{
  int N;
  cin >> N;
  solve(N);
  return 0;
}
  

Compiler output:
a.cc: In function 'int solve(int*)':
a.cc:19:1: warning: no return statement in function returning non-void [-Wreturn-type]
   19 | }
      | ^
a.cc: In function 'int main()':
a.cc:25:9: error: invalid conversion from 'int' to 'int*' [-fpermissive]
   25 |   solve(N);
      |         ^
      |         |
      |         int
a.cc:5:16: note:   initializing argument 1 of 'int solve(int*)'
    5 | int solve(int *n)
      |           ~~~~~^
Language: C

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

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

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

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

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
#define all(x) x.begin(), x.end()

signed main() {
	int n;
	string s;
	cin >> n >> s;
	int ans = 0;
	rep(i, n-2){
		string abc = s[i] + s[i+1] + s[i+2];
		if(abc == "ABC") ans++;
	}
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:44: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   13 |                 string abc = s[i] + s[i+1] + s[i+2];
Language: C++


using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
#define all(x) x.begin(), x.end()

signed main() {
	int n;
	string s;
	cin >> n >> s;
	int ans = 0;
	rep(i, n-2){
		string abc = s[i] + s[i+1] + s[i+2];
		if(abc == "ABC") ans++;
	}
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'string' was not declared in this scope
    9 |         string s;
      |         ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | 
a.cc:10:9: error: 'cin' was not declared in this scope
   10 |         cin >> n >> s;
      |         ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | 
a.cc:10:21: error: 's' was not declared in this scope
   10 |         cin >> n >> s;
      |                     ^
a.cc:13:23: error: expected ';' before 'abc'
   13 |                 string abc = s[i] + s[i+1] + s[i+2];
      |                       ^~~~
      |                       ;
a.cc:14:20: error: 'abc' was not declared in this scope
   14 |                 if(abc == "ABC") ans++;
      |                    ^~~
a.cc:16:9: error: 'cout' was not declared in this scope
   16 |         cout << ans << endl;
      |         ^~~~
a.cc:16:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:16:24: error: 'endl' was not declared in this scope
   16 |         cout << ans << endl;
      |                        ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 |
Language: Java

import java.util.*;
 
class Main{
  public static void main(String[] args){
    Scanner ISR = new Scanner(System.in);
    int N = ISR.nextInt();
    String St = ISR.next();
    int R = 0;
    for(int i = 0;i<N-2;i++){
      if(St.charAt(i)=="A"){
        if(St.charaAt(i+1)=="B"){
          if(St.charAt(i+2)=="C"){
            R++;
          }
        }
      }
    }
    System.out.println(R);
  }
}

Compiler output:
Main.java:10: error: bad operand types for binary operator '=='
      if(St.charAt(i)=="A"){
                     ^
  first type:  char
  second type: String
Main.java:11: error: cannot find symbol
        if(St.charaAt(i+1)=="B"){
             ^
  symbol:   method charaAt(int)
  location: variable St of type String
Main.java:12: error: bad operand types for binary operator '=='
          if(St.charAt(i+2)=="C"){
                           ^
  first type:  char
  second type: String
3 errors
Language: Java

import java.util.*;
 
class Main{
  public static void main(String[] args){
    Scanner ISR = new Scanner(System.in);
    int N = ISR.nextInt();
    String St = ISR.next();
    int R = 0;
    for(int i = 0;i<N-2;i++){
      if(St.charAt(i).equals("A")){
        if(St.charaAt(i+1).equals("B")){
          if(St.charAt(i+2).equals("C")){
            R++;
          }
        }
      }
    }
    System.out.println(R);
  }
}

Compiler output:
Main.java:10: error: char cannot be dereferenced
      if(St.charAt(i).equals("A")){
                     ^
Main.java:11: error: cannot find symbol
        if(St.charaAt(i+1).equals("B")){
             ^
  symbol:   method charaAt(int)
  location: variable St of type String
Main.java:12: error: char cannot be dereferenced
          if(St.charAt(i+2).equals("C")){
                           ^
3 errors
Language: Java

import java.util.*;
 
class Main{
  public static void main(String[] args){
    Scanner ISR = new Scanner(System.in);
    int N = ISR.nextInt();
    String St = ISR.next();
    int R = 0;
    for(int i = 0;i<N-2;i++){
      if(charAt(i).equals("A")){
        if(charaAt(i+1).equals("B")){
          if(charAt(i+2).equals("C")){
            R++;
          }
        }
      }
    }
    System.out.println(R);
  }
}

Compiler output:
Main.java:10: error: cannot find symbol
      if(charAt(i).equals("A")){
         ^
  symbol:   method charAt(int)
  location: class Main
Main.java:11: error: cannot find symbol
        if(charaAt(i+1).equals("B")){
           ^
  symbol:   method charaAt(int)
  location: class Main
Main.java:12: error: cannot find symbol
          if(charAt(i+2).equals("C")){
             ^
  symbol:   method charAt(int)
  location: class Main
3 errors
Language: Java

import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner ISR = new Scanner(System.in);
    int N = ISR.nextInt();
    String St = ISR.next();
    int R = 0;
    for(int i = 0;i<N;i++){
      if(i<N-2&&St.substring(i,i+1).equals("A")){
        i++;
        if(&&St.substring(i,i+1).equals("B")){
          i++;
          if(St.substring(i,i+1).equals("C")){
            i++;
            R++;
          }
        }
      }
    }
    System.out.println(R);
  }
}

Compiler output:
Main.java:12: error: illegal start of expression
        if(&&St.substring(i,i+1).equals("B")){
           ^
1 error
Language: Java

import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner ISR = new Scanner(System.in);
    int N = ISR.nextInt();
    String St = ISR.next();
    int R = 0;
    for(int i = 0;i<N;i++){
      if(St.substring(i,i+1).equals("A")){
        i++;
        if(St.substring(i,i+1).equals("B")){
          i++;
          if(St.substring(i,i+1).equals("C")){
            i++;
            R++;
          }
        }
      }
    }

Compiler output:
Main.java:20: error: reached end of file while parsing
    }
     ^
1 error
Language: C++

#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    string s;
    cin>>s;
    int num=0;
    for(int i=0;i<n-3;i++){
        if(s[i]=="A"&&s[i+1]=="B"&&s[i+2]=="C"){
            num++;
        }
    }
    cout<<num<<endl;
    

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |         if(s[i]=="A"&&s[i+1]=="B"&&s[i+2]=="C"){
a.cc:13:29: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |         if(s[i]=="A"&&s[i+1]=="B"&&s[i+2]=="C"){
a.cc:13:42: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |         if(s[i]=="A"&&s[i+1]=="B"&&s[i+2]=="C"){
Language: C++

#include<iostream>
#include<string>
 
int main(){
	int N;
  	std::cin >> N;
  	std::string ABC[N];
  	std::string test{"ABC"};
  	for (int i = 0; i < N; i++){
    	std::cin >> ABC[i];
    }
  	int abcs = 0;
  	for (int i = 0; i < N-2; i++){
    	if (ABC.substr(i,3) == test) abcs++; 
    }
  	std::cout << abcs;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: request for member 'substr' in 'ABC', which is of non-class type 'std::string [N]' {aka 'std::__cxx11::basic_string<char> [N]'}
   14 |         if (ABC.substr(i,3) == test) abcs++;
      |                 ^~~~~~
Language: C++

#include<iostream>
#include<string>
 
int main(){
	int N;
  	std::cin >> N;
  	std::string ABC[N];
  	for (int i = 0; i < N; i++){
    	std::cin >> ABC[i];
    }
  	int abcs = 0;
  	for (int i = 0; i < N-2; i++){
    	if (ABC.substr(i,3) == "ABC") abcs++; 
    }
  	std::cout << abcs;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: request for member 'substr' in 'ABC', which is of non-class type 'std::string [N]' {aka 'std::__cxx11::basic_string<char> [N]'}
   13 |         if (ABC.substr(i,3) == "ABC") abcs++;
      |                 ^~~~~~
Language: C++

#include<iostream>
#include<string>

int main(){
	int N;
  	std::cin >> N;
  	std::string ABC[N];
  	for (int i = 0; i < N; i++){
    	std::cin >> ABC[i];
    }
  	int abcs = 0;
  	for (int i = 0; i < N-2; i++){
    	if (ABC[i:i+2] == "ABC") abcs++; 
    }
  	std::cout << abcs;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:18: error: found ':' in nested-name-specifier, expected '::'
   13 |         if (ABC[i:i+2] == "ABC") abcs++;
      |                  ^
      |                  ::
a.cc:13:17: error: 'i' is not a class, namespace, or enumeration
   13 |         if (ABC[i:i+2] == "ABC") abcs++;
      |                 ^
Language: C++

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

int main() {
  int N;
  string S;
  cin >> N >> S;
  cout << count(S.begin(), S.end(), "ABC") << "\n";
}

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:8:16:   required from here
    8 |   cout << count(S.begin(), S.end(), "ABC") << "\n";
      |           ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/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: C++

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

int main () {
    int N;
    string S;
    cin >> N >> S;
    int count=0;
    
    for (int i=0; i<N-2; i++) {
        if (S.at(i)=="A" && S.at(i+1)=="B" && S.at(i+2)=="C") {
            count++;
        }
    }
    cout << count << endl;
}            

Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |         if (S.at(i)=="A" && S.at(i+1)=="B" && S.at(i+2)=="C") {
      |             ~~~~~~~^~~~~
a.cc:11:38: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |         if (S.at(i)=="A" && S.at(i+1)=="B" && S.at(i+2)=="C") {
      |                             ~~~~~~~~~^~~~~
a.cc:11:56: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |         if (S.at(i)=="A" && S.at(i+1)=="B" && S.at(i+2)=="C") {
      |                                               ~~~~~~~~~^~~~~
Language: Java

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

public class Main {
 public static void main (String[] args) {
  Scanner sc = new Scanner (System.in);
   int n = sc.nextInt();
   char[] arr = sc.next().toCharArray();
   int count = 0;
   for (int = 0; i<n-3; i++) {
     if (arr[i] == 'A' && arr[i+1] == 'B' && arr[i+2] == 'C') 
       count++;
   }
   System.out.println(count);
 }
}

Compiler output:
Main.java:11: error: not a statement
   for (int = 0; i<n-3; i++) {
        ^
Main.java:11: error: ';' expected
   for (int = 0; i<n-3; i++) {
           ^
Main.java:11: error: illegal start of expression
   for (int = 0; i<n-3; i++) {
            ^
Main.java:11: error: not a statement
   for (int = 0; i<n-3; i++) {
                  ^
Main.java:11: error: ')' expected
   for (int = 0; i<n-3; i++) {
                      ^
Main.java:11: error: ';' expected
   for (int = 0; i<n-3; i++) {
                           ^
6 errors
Language: C++

#include <algorithm>
#include <iostream>
#include <vector>
#include <functional>
#include <string>
#include <cmath>  //sqrt 
#include <iomanip> //setprecision
using namespace std;

int main(){
    int n ; cin >> n;
    string s; cin >>  s;
    cout << count(s.begin(),s.end(),"ABC") << endl;
    return 0;
}

Compiler output:
In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
                 from /usr/include/c++/14/algorithm:60,
                 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:13:18:   required from here
   13 |     cout << count(s.begin(),s.end(),"ABC") << endl;
      |             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/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: C++

#include <algorithm>
#include <iostream>
#include <vector>
#include <functional>
#include <string>
#include <cmath>  //sqrt 
#include <iomanip> //setprecision
using namespace std;

int main(){
    int n ; cin >> n;
    string s;
    s.resize(n);
    cout << count(s.begin(),s.end(),"ABC") << endl;
    return 0;
}

Compiler output:
In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
                 from /usr/include/c++/14/algorithm:60,
                 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:14:18:   required from here
   14 |     cout << count(s.begin(),s.end(),"ABC") << endl;
      |             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/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: C

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

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

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#define rep(i,n) for(i=0;i<n;i++)
#define PI 3.14159265358979323846264338327950L
int main(){
    int n;
    scanf("%d",&n);
    char s[n];
    scanf("%s",s);
    int i,cnt=0;
    rep(i,n-2){
        if(s[i]=='A'&&a[i+1]=='B'&&s[i+2]=='C') cnt++;
    }
    printf("%d",cnt);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:23: error: 'a' undeclared (first use in this function)
   13 |         if(s[i]=='A'&&a[i+1]=='B'&&s[i+2]=='C') cnt++;
      |                       ^
main.c:13:23: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void p(vector<int> A){rep(i,A.size()){cout << A[i] << " ";}cout << "\n";}

int main(){
    int n;
    string s;
    cin >> n >> s;
    cout << count(s.cbegin(),s.cend(),"ABC");
}

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:3:
/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<const 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<const 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<const 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:12:18:   required from here
   12 |     cout << count(s.cbegin(),s.cend(),"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: C++

#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void p(vector<int> A){rep(i,A.size()){cout << A[i] << " ";}cout << "\n";}

int main(){
    int n;
    string s;
    cin >> n >> s;
    cout << count(s.begin(),s.end(),"ABC");
}

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:3:
/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:12:18:   required from here
   12 |     cout << 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: C++

#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void p(vector<int> A){rep(i,A.size()){cout << A[i] << " ";}cout << "\n";}

int main(){
    int n;
    string s;
    cout << count(s.begin(),s.end(),"ABC");
}

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:3:
/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:11:18:   required from here
   11 |     cout << 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: C++

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

int main() {
   int n;
  string s;
  cin >> n >> s;
  int ans;
  
  for(int i = 0;i <= n - 3; i++){
    if(s[i] == "A" && s[i + 1] == "B" && s[i + 2] == "C") ans++;
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(s[i] == "A" && s[i + 1] == "B" && s[i + 2] == "C") ans++;
a.cc:11:32: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(s[i] == "A" && s[i + 1] == "B" && s[i + 2] == "C") ans++;
a.cc:11:51: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(s[i] == "A" && s[i + 1] == "B" && s[i + 2] == "C") ans++;
Language: C++

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

int main() {
   int n;
  string s;
  cin >> n >> s;
  ins ans;
  
  for(int i = 0;i <= n - 3; i++){
    if(s[i] == "A" && s[i + 1] == "B" && s[i + 2] == "C") ans++;
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'ins' was not declared in this scope; did you mean 'int'?
    8 |   ins ans;
      |   ^~~
      |   int
a.cc:11:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(s[i] == "A" && s[i + 1] == "B" && s[i + 2] == "C") ans++;
a.cc:11:32: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(s[i] == "A" && s[i + 1] == "B" && s[i + 2] == "C") ans++;
a.cc:11:51: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(s[i] == "A" && s[i + 1] == "B" && s[i + 2] == "C") ans++;
a.cc:11:59: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |     if(s[i] == "A" && s[i + 1] == "B" && s[i + 2] == "C") ans++;
      |                                                           ^~~
      |                                                           abs
a.cc:13:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

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

int main() {
   int n;
  string s;
  cin >> n, s;
  ins ans;
  
  for(int i = 0;i <= n - 3; i++){
    if(s[i] == "A" && s[i + 1] == "B" && s[i + 2] == "C") ans++;
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'ins' was not declared in this scope; did you mean 'int'?
    8 |   ins ans;
      |   ^~~
      |   int
a.cc:11:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(s[i] == "A" && s[i + 1] == "B" && s[i + 2] == "C") ans++;
a.cc:11:32: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(s[i] == "A" && s[i + 1] == "B" && s[i + 2] == "C") ans++;
a.cc:11:51: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(s[i] == "A" && s[i + 1] == "B" && s[i + 2] == "C") ans++;
a.cc:11:59: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |     if(s[i] == "A" && s[i + 1] == "B" && s[i + 2] == "C") ans++;
      |                                                           ^~~
      |                                                           abs
a.cc:13:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int N;
  int count = 0;
  string str;
  
  cin >> N;
  cin >> str;
  
  for (int i = 0; i < N; i++)
    if (str.at(i) == 'A' $$ i < 48){
      i++;
      if (str.at(i) == 'B'){
        i++;
        if (str.at(i) == 'C')
          count++;
      }
    }
  cout << count;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:25: error: expected ')' before '$$'
   13 |     if (str.at(i) == 'A' $$ i < 48){
      |        ~                ^~~
      |                         )
Language: C++

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

int main() {
  int N ; 
  string S ; 
  int T = 0 ; 
  
  cin >> N ; 
  cin >> S ; 
  
  for (int i = 0 ; i < S.size()-2 ; i++){
    if(S.at(i) == 'A' && S.at(i+1) == 'B' && S.at(i+2) == 'C' ){
      T++ ;
    }
  }
  
  
  cout << T << endl ; 
  
}

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

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  string str;
  cin>>str;
  int count=0;
  for(int i=0;i<N-2;i++){
    if(str.at(i)=='A'&&str.at(i+1)=='B'&&str.at(i+2)=='C'){
      count++;
    }
  }
  cout<<count<<endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:14:21: error: expected '}' at end of input
   14 |   cout<<count<<endl;
      |                     ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: Java

//ABC150 B

package atcoder01;

import java.util.Scanner;

public class Main45 {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		String s = sc.next();
		int count = 0;

		for(int i=0 ; i<=s.length()-3 ; i++) {
			if(s.charAt(i)=='A' && s.charAt(i+1)=='B' && s.charAt(i+2)=='C') {
				count++;
			}
		}

		System.out.println(count);

		sc.close();

	}

}


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

import java.util.*;
public class Main {
  public static int countString(String S, String word) {
  	//Sに調べたい文字列を、wordに数えたい文字列を入れる。
    String reS = S.replace(word,"");
    int ans = (S.length() - reS.length())/word.length();
    return ans;
  }
  public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    String S = sc.next();
    System.out.println(countString(S,"ABC"));
  }

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

#include <stdio.h>

int main(){
	int N;
  	char S[50];
  	int count=0;
  	int i;
  	scanf("%d",&N);
  	scanf(" %c",S[0])
  	for(i=1;i<N;i++){
      scanf("%c",S[i]);
  	}
  	for(i=0;i<N-3;i++){
    	if(S[i]=='A'&&S[i+1]=='B'&&S[i+2]=='C'){
        	count++;
        }
    }
  	printf("%d\n",count);
  	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:9:26: error: expected ';' before 'for'
    9 |         scanf(" %c",S[0])
      |                          ^
      |                          ;
   10 |         for(i=1;i<N;i++){
      |         ~~~
Language: C++

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

#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rep2(i,s,n) for(int i = (s); i < (n); ++i)
#define ll long long
#define ld long double
#define P pair<ll,ll>
#define all(v) v.begin(),v.end()

const ll mod = 1e9+7;
const ll INF = 1e18;
const double pi = acos(-1.0);

int main(void)
{
    ll n; cin>>n;
    string s; cin>>s;
    ll ans=0;
    rep(i,s.size()-2){
        if(s.substr(i,3)=="ABC") ++ans;
    }
    cout<<ans<<endl;
    return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:24:14: error: expected '}' at end of input
   24 |     return 0;
      |              ^
a.cc:16:1: note: to match this '{'
   16 | {
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N; cin>>N;
  string S; cin>>S;
  int L=0;
  for(int i=0; i<S.size()-2); i++){
    if(S.at(i)=='A'&&S.at(i+1)=='B'&&S.at(i+2)=='C')
      L++;
    else continue;
  }
  cout<<L<<endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:28: error: expected ';' before ')' token
    7 |   for(int i=0; i<S.size()-2); i++){
      |                            ^
      |                            ;
a.cc:7:31: error: 'i' was not declared in this scope
    7 |   for(int i=0; i<S.size()-2); i++){
      |                               ^
Language: C++

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

int main() {
  int n; cin >> n;
  string s; string >> s;
  int ans = 0;
  
  rep(i,n-2){
   if(s[i] == 'A' && s[i+1] == 'B' && s[i+2] == 'C') ans++;
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:20: error: expected unqualified-id before '>>' token
    8 |   string s; string >> s;
      |                    ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 int main(){string s;cin>>s;int count=0;char a='A',b='B',c='C';for(int i=0;i<(int)s.size-2;i++){if(s[i]==a && s[i+1]==b && s[i+2]==c)count++;}cout << count;}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:85: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
    3 |  int main(){string s;cin>>s;int count=0;char a='A',b='B',c='C';for(int i=0;i<(int)s.size-2;i++){if(s[i]==a && s[i+1]==b && s[i+2]==c)count++;}cout << count;}
      |                                                                                   ~~^~~~
      |                                                                                         ()
Language: C++

#include <bits/stdc++.h>
using namespace std;
 int main(){string s;cin>>s;int count=0;for(int i=0;i<(int)s.size-2;i++){if(s[i]=='A' && s[i+1]=='B' && s[i+2]=='C')count++;}cout << count;}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:62: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
    3 |  int main(){string s;cin>>s;int count=0;for(int i=0;i<(int)s.size-2;i++){if(s[i]=='A' && s[i+1]=='B' && s[i+2]=='C')count++;}cout << count;}
      |                                                            ~~^~~~
      |                                                                  ()
Language: C++

#include <iostream>
using namespace std;
int main(){
  int ans = 0;
  int n = 0;
  cin >> n;
  string s;
  cin  >> s;
  string lst;
  for(const char& i : s){
    if(i == "AB") lst += 'A';
    if(lst + i == "AB") lst += 'B';
    if (lst + i == "ABC") {
      ans++;
      lst = "";
     }
    
  }
    
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(i == "AB") lst += 'A';
      |        ~~^~~~~~~
Language: C++

#include<bits/stdc++.h>
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define repr(i,a,b) for(int i=a;i>=b;i--)
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define pc _putchar_nolock
#define mp make_pair
#define mt make_tuple
#define um unordered_map
#define inf (ll)9223372036854775807
using namespace std;
using ll=long long int;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
void input(vector<int>&a,int n)
{
   rep(i,0,n-1)
   cin>>a[i];
}
void solve()
{
  int n; cin>>n; string s; cin>>s; 
  if(n<3)
  {
  	cout<<0<<"\n"; return;
  }
  vector<int>a; 
  rep(i,0,n-1)
  {
  	if(s[i]=='A') a.eb(i);
  }
  if(sz(a)==0)
  {
  	cout<<0<<"\n"; return;
  }
  int res=0;
  for(auto i:a)
  {
  	if(i<n-2 and s[i+1]=='B' and s[i+2]=='C') res++;
  }
  cout<<res<<"\n";
}
int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int t=1;
  while(t--)
  {
	 solve();
  }
  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:62:6: error: 'sz' was not declared in this scope; did you mean 's'?
   62 |   if(sz(a)==0)
      |      ^~
      |      s
Language: C++

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

int main()
{
  string s;
  cin >> s;
  int ans = 0;
  rep(i.s.size() - 2){
    if(s[i] == 'A' && s[i+1] == 'B' && s[i+2] == 'C') ans++;
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc:13:21: error: macro "rep" requires 2 arguments, but only 1 given
   13 |   rep(i.s.size() - 2){
      |                     ^
a.cc:2:9: note: macro "rep" defined here
    2 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
      |         ^~~
a.cc: In function 'int main()':
a.cc:13:3: error: 'rep' was not declared in this scope
   13 |   rep(i.s.size() - 2){
      |   ^~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: expected ';' before '}' token
    9 |         ans++
      |              ^
      |              ;
   10 |     }
      |     ~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: expected ';' before '}' token
    9 |         ans++
      |              ^
      |              ;
   10 |     }
      |     ~         
a.cc: At global scope:
a.cc:12:3: error: 'cout' does not name a type
   12 |   cout << ans << endl;
      |   ^~~~
a.cc:13:1: error: expected declaration before '}' token
   13 | }
      | ^