criyle/codenet-compile-errors huggingface dataset:
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:8:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |       if(s[i]=="A"&&s[i+1]=="B"&&s[i+2]==C)
a.cc:8:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |       if(s[i]=="A"&&s[i+1]=="B"&&s[i+2]==C)
a.cc:8:42: error: 'C' was not declared in this scope
    8 |       if(s[i]=="A"&&s[i+1]=="B"&&s[i+2]==C)
      |                                          ^
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 | }
      | ^
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:6:5: error: expected ',' or ';' before 'cin'
    6 |     cin >> n >> s;
      |     ^~~
a.cc:8:18: error: lvalue required as left operand of assignment
    8 |     if(s[i]=='A' && s[i+1]='B' && s[i+2]=='C'){
Language: C++

#include<iostream>
using namespace std;
int main(){
  string s;
  int n,i;
  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:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |       ans++;
      |       ^~~
      |       abs
a.cc:12:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |   cout << ans << endl;
      |           ^~~
      |           abs
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:8:18: error: lvalue required as left operand of assignment
    8 |     if(s[i]=='A' && s[i+1]='B' && s[i+2]=='C'){
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:8:32: error: lvalue required as left operand of assignment
    8 |     if(s[i]=='A' && s[i+1]='B' && s[i+2]='C'){
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"){
      if(S.at(i+1)=="B"){
        if(S.at(i+2)=="C"){
          count++;
        }
      }
    }
  }
}




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

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


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


Compiler output:
a.cc: In function 'int main()':
a.cc:13:36: error: 'A' was not declared in this scope
   13 |                 if (S[i] == 'A' && A[i + 1] == 'B' && S[i + 2] == 'C') {
      |                                    ^
Language: C++


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


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


Compiler output:
a.cc: In function 'int main()':
a.cc:13:29: error: 'n' was not declared in this scope
   13 |         for (int i = 0; i < n - 2; ++i) {
      |                             ^
a.cc:14:36: error: 'A' was not declared in this scope
   14 |                 if (S[i] == 'A' && A[i + 1] == 'B' && S[i + 2] == 'C') {
      |                                    ^
Language: C

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

int main()
{
    int N, counT = 0;
    cin >> N;

    char str[N];
    scanf("%s", &str);

    for(int i=0; i<N-2; i++)
    {
        if(str[i]=='A' && str[i+1]=='B' && str[i+2]=='C')
        {
            counT++;
            i += 2;
        }
    }

    cout << counT;

    return 0;
}


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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: 'A' was not declared in this scope
   10 |     if(str.at(i)==A && str.at(i+1)==B && str.at(i+2)==C){
      |                   ^
a.cc:10:37: error: 'B' was not declared in this scope
   10 |     if(str.at(i)==A && str.at(i+1)==B && str.at(i+2)==C){
      |                                     ^
a.cc:10:55: error: 'C' was not declared in this scope
   10 |     if(str.at(i)==A && str.at(i+1)==B && str.at(i+2)==C){
      |                                                       ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: overloaded function with no contextual type information
    7 |   count=0
      |         ^
a.cc:8:11: error: 'i' was not declared in this scope
    8 |   for(i=0;i<str.size();i++){
      |           ^
Language: C++

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

int main() {
  int n;
  string s;
  int k=0;
  rep(i,n-2){
    if(s.substr(i,3)=="ABC"){
      k++;
    }
    
    
  cout << k <<endl;
}
  




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

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

int main() {
  int n;
  string s;
  int k=0;
  rep(i,n){
    if(s.at(i)==A){
      if(s.at(i+1)==B){
        if(s.at(i+2)==C){
          k++;
        }
      }
    }
  }
  cout << k <<endl;
}
  




Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'A' was not declared in this scope
   11 |     if(s.at(i)==A){
      |                 ^
a.cc:12:21: error: 'B' was not declared in this scope
   12 |       if(s.at(i+1)==B){
      |                     ^
a.cc:13:23: error: 'C' was not declared in this scope
   13 |         if(s.at(i+2)==C){
      |                       ^
Language: C++

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

int main() {
  int n;
  string s;
  int k=0;
  rep(i,n){
    if(s.at(i)=="A"){
      if(s.at(i+1)=="B"){
        if(s.at(i+2)=="C"){
          k++;
        }
      }
    }
  }
  cout << k <<endl;
}
  




Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(s.at(i)=="A"){
      |        ~~~~~~~^~~~~
a.cc:12:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |       if(s.at(i+1)=="B"){
      |          ~~~~~~~~~^~~~~
a.cc:13:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |         if(s.at(i+2)=="C"){
      |            ~~~~~~~~~^~~~~
Language: C++

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

int main() {
  int n;
  string s;
  int k=0;
  rep(i,n){
    if(s.at(i)=="a"){
      if(s.at(i+1)=="b"){
        if(s.at(i+2)=="c"){
          k++;
        }
      }
    }
  }
  cout << k <<endl;
}
  




Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(s.at(i)=="a"){
      |        ~~~~~~~^~~~~
a.cc:12:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |       if(s.at(i+1)=="b"){
      |          ~~~~~~~~~^~~~~
a.cc:13:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |         if(s.at(i+2)=="c"){
      |            ~~~~~~~~~^~~~~
Language: Java

import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
    
    Scanner sc = new Scanner(System.in);
      
      //入力
      int N =sc.nextInt();//文字列の長さ
      String S =sc.next();//文字列  
      char[] T =S.toCharArray();
      int count = 0;
      
      //いくつABCが含まれているか
   	  for(int i =0; i<N; i++){
        if(T[i] =='A' && T[i+1] =='B' && T[i+2] =='C'){
       	  	count++;
        }	
      }
      　//出力
      	System.out.println(count); 
    }
}

Compiler output:
Main.java:19: error: illegal character: '\u3000'
      ?//??
      ^
1 error
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: expected ';' before ')' token
    9 |   for(int i=0;i<n-2){
      |                    ^
      |                    ;
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:20: error: expected ';' before '}' token
   15 |   cout << Y << endl
      |                    ^
      |                    ;
   16 | }
      | ~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:28: error: 'n' was not declared in this scope
   10 |         for(int i=0 ; i <= n-3 ; i++){
      |                            ^
Language: Java

import java.util.Scanner;

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;
    for (int i=0; i<s.length()-2; i++) {
      if (s.charAt(i) == 'A' && s.charAt(i+1) == 'B' && s.charAt(i+2)) {
        count++;
      }
    }
    sc.close();
    System.out.println(count);
  }
}


Compiler output:
Main.java:10: error: bad operand types for binary operator '&&'
      if (s.charAt(i) == 'A' && s.charAt(i+1) == 'B' && s.charAt(i+2)) {
                                                     ^
  first type:  boolean
  second type: char
1 error
Language: Java

import java.util.Scanner;

public Main {
  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()-2; i++) {
      if (s.charAt(i) == 'A' && s.charAt(i+1) == 'B' && s.charAt(i+2)) {
        count++;
      }
    }
    sc.close();
    System.out.println(count);
  }
}

Compiler output:
Main.java:3: error: class, interface, enum, or record expected
public Main {
       ^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
  public static void main(String[] args) {
                ^
  (use --enable-preview to enable unnamed classes)
Main.java:17: error: class, interface, enum, or record expected
}
^
3 errors
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;i++){
    if (i==0||i==1){
    }
    else {
      if (S.at(i-2)=="A"&&S.at(i-1)=="B"&&S.at(i)=="C"){
        ans+=1;
      }
      else{
      }
    }
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |       if (S.at(i-2)=="A"&&S.at(i-1)=="B"&&S.at(i)=="C"){
      |           ~~~~~~~~~^~~~~
a.cc:13:36: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |       if (S.at(i-2)=="A"&&S.at(i-1)=="B"&&S.at(i)=="C"){
      |                           ~~~~~~~~~^~~~~
a.cc:13:50: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |       if (S.at(i-2)=="A"&&S.at(i-1)=="B"&&S.at(i)=="C"){
      |                                           ~~~~~~~^~~~~
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;i++){
    if (i==0||i==1){
    }
    else {
      if (S.at(i-2)==A&&S.at(i-1)==B&&S.at(i)==C){
        ans+=1;
      }
      else{
      }
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:22: error: 'A' was not declared in this scope
   13 |       if (S.at(i-2)==A&&S.at(i-1)==B&&S.at(i)==C){
      |                      ^
a.cc:13:36: error: 'B' was not declared in this scope
   13 |       if (S.at(i-2)==A&&S.at(i-1)==B&&S.at(i)==C){
      |                                    ^
a.cc:13:48: error: 'C' was not declared in this scope
   13 |       if (S.at(i-2)==A&&S.at(i-1)==B&&S.at(i)==C){
      |                                                ^
Language: C++

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

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

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


int main() {

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: error: 'n' was not declared in this scope
   10 |         for(int i=0; i <n-3; i++) {
      |                         ^
a.cc:11:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |         if(x[i] == "A" && x[i + 1] == "B" && x[i + 2] == "C") ans ++;
a.cc:11:36: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |         if(x[i] == "A" && x[i + 1] == "B" && x[i + 2] == "C") ans ++;
a.cc:11:55: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |         if(x[i] == "A" && x[i + 1] == "B" && x[i + 2] == "C") ans ++;
Language: C

#include <stdio.h>
int main(void){

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


 return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:22: warning: comparison between pointer and integer
   10 |         if(S[N-(i+3)]=="A"&&S[N-(i+2)]=="B"&&[N-(i+1)]=="C"){
      |                      ^~
main.c:10:39: warning: comparison between pointer and integer
   10 |         if(S[N-(i+3)]=="A"&&S[N-(i+2)]=="B"&&[N-(i+1)]=="C"){
      |                                       ^~
main.c:10:46: error: expected expression before '[' token
   10 |         if(S[N-(i+3)]=="A"&&S[N-(i+2)]=="B"&&[N-(i+1)]=="C"){
      |                                              ^
Language: C

#include <stdio.h>
int main(void){

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


 return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:22: warning: comparison between pointer and integer
   10 |         if(S[N-(i+3)]=="A",S[N-(i+2)]=="B",[N-(i+1)]=="C"){
      |                      ^~
main.c:10:38: warning: comparison between pointer and integer
   10 |         if(S[N-(i+3)]=="A",S[N-(i+2)]=="B",[N-(i+1)]=="C"){
      |                                      ^~
main.c:10:44: error: expected expression before '[' token
   10 |         if(S[N-(i+3)]=="A",S[N-(i+2)]=="B",[N-(i+1)]=="C"){
      |                                            ^
Language: C

#include <stdio.h>
int main(void){

  char S[51]={0};
  int N=0;
  int count=0;
  scanf("%d",&N);
  
  for(int i=0;i<N;i++){
  	if(S[N-(i+3)]=="A",S[N-(i+2)]=="B",[N-(i+1)]=="C"){
    	count++;
      i+=2;
    }
  }
  


 return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:22: warning: comparison between pointer and integer
   10 |         if(S[N-(i+3)]=="A",S[N-(i+2)]=="B",[N-(i+1)]=="C"){
      |                      ^~
main.c:10:38: warning: comparison between pointer and integer
   10 |         if(S[N-(i+3)]=="A",S[N-(i+2)]=="B",[N-(i+1)]=="C"){
      |                                      ^~
main.c:10:44: error: expected expression before '[' token
   10 |         if(S[N-(i+3)]=="A",S[N-(i+2)]=="B",[N-(i+1)]=="C"){
      |                                            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  string s;
  cin >> n >> s;
   
  int ans=0;
  for(int 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:11:16: error: 'A' was not declared in this scope
   11 |     if(s[i] == A && s[i+1] == B && s[i+2] == C){
      |                ^
a.cc:11:31: error: 'B' was not declared in this scope
   11 |     if(s[i] == A && s[i+1] == B && s[i+2] == C){
      |                               ^
a.cc:11:46: error: 'C' was not declared in this scope
   11 |     if(s[i] == A && s[i+1] == B && s[i+2] == C){
      |                                              ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  string s;
  cin >> n >> s;
   
  int ans=0;
  for(int 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: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"){
a.cc:11:30: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(s[i] == "A" && s[i+1] == "B" && s[i+2] == "C"){
a.cc:11:47: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(s[i] == "A" && s[i+1] == "B" && s[i+2] == "C"){
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  string s;
  cin >> n >> s;
   
  int ans=0;
  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:10:7: error: 'i' was not declared in this scope
   10 |   for(i=0; i<n-2; i++){
      |       ^
Language: C++

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

int ans=0;
bool ABC(char X,char Y,char Z){
  return X=='A'&&Y=='B'&&Z=='C'?1:0;
}

int main(){
  int N;string str;cin>>N>>str;
  for(int i=0;i<str.size()-2;i++){
    if(ABC(str.at[i],str.at[i+1],str.at[i+2])){
      ans++;
    }
  }
  cout << ans <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:18: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   12 |     if(ABC(str.at[i],str.at[i+1],str.at[i+2])){
      |                  ^
a.cc:12:28: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   12 |     if(ABC(str.at[i],str.at[i+1],str.at[i+2])){
      |                            ^
a.cc:12:40: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   12 |     if(ABC(str.at[i],str.at[i+1],str.at[i+2])){
      |                                        ^
Language: C++

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

int ans=0;
bool ABC(char X,char Y,char Z){
  return X=='A'&&Y=='B'&&Z=='C'?1:0;
}

int main(){
  int N;string str;cin>>N>>str;
  for(int i=0;i<str.size()-2;i++){
    if(ABC(str.at[i],str.at[i+1],str.at[i+2]){
      ans++;
    }
       }
  cout << ans <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:18: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   12 |     if(ABC(str.at[i],str.at[i+1],str.at[i+2]){
      |                  ^
a.cc:12:28: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   12 |     if(ABC(str.at[i],str.at[i+1],str.at[i+2]){
      |                            ^
a.cc:12:40: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   12 |     if(ABC(str.at[i],str.at[i+1],str.at[i+2]){
      |                                        ^
a.cc:12:46: error: expected ')' before '{' token
   12 |     if(ABC(str.at[i],str.at[i+1],str.at[i+2]){
      |       ~                                      ^
      |                                              )
a.cc:15:8: error: expected primary-expression before '}' token
   15 |        }
      |        ^
Language: C++

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

int main() {
  string str;
  cin >> str;

  int count = 0;
  for (int i = 0; i < str.size(); i++) {
    if (str.at(i) == "ABC") {
      count++;
    }
  }

  cout << count << endl;
}


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

#include <stdio.h>

int main() {
	int ans = 0;
	int N;
	scanf("%d\n", &N);
	char s[N];
	char search[3] = "ABC";
	for (int i = 0; i < N - 2; i++) {
		bool f = true;
		for (int j = 0; j < 3; j++) {
			if (s[i + j] != search[j]) {
				f = false;
				break;
			}
		}
		if (f) ans++;
	}
	printf("%d\n", ans);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:26: error: initializer-string for 'char [3]' is too long [-fpermissive]
    8 |         char search[3] = "ABC";
      |                          ^~~~~
Language: C++

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

int main(){
  int N ; cin >> N ;
  string S ; cin >> S ;
  int ans = 0 ;
  for(int 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: 'A' was not declared in this scope
    9 |     if(S[i]==A&&S[i+1]==B&&S[i+2]==C) ans++;
      |              ^
a.cc:9:25: error: 'B' was not declared in this scope
    9 |     if(S[i]==A&&S[i+1]==B&&S[i+2]==C) ans++;
      |                         ^
a.cc:9:36: error: 'C' was not declared in this scope
    9 |     if(S[i]==A&&S[i+1]==B&&S[i+2]==C) ans++;
      |                                    ^
Language: Java

mport java.util.*;

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

        int val1 = sc.nextInt();
        String val2 = sc.next();

        int count = 0;
        String temp = "";
        for (int i = 0; i < val2.length(); i++) {
            temp = temp + val2.charAt(i);
            switch (temp) {
                case "A":
                    continue;
                case "AB":
                    continue;
                case "ABC":
                    count++;
                    temp = "";
                    continue;
                default:
                    temp = "" + temp.charAt(temp.length() - 1);

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

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.*;
^
Main.java:29: error: reached end of file while parsing
    }
     ^
2 errors
Language: C

#include<stdio.h>
int main()
  { 
    int N,count=0,i;
  scanf("%d",&N);
  char S[N];
  scanf("%s",S);

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: expected ')' before ';' token
   10 |   if(int i;i<n;i++){
      |     ~         ^
      |               )
a.cc:10:16: error: 'i' was not declared in this scope
   10 |   if(int i;i<n;i++){
      |                ^
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;
int main() {
  int n; cin >> n;
  vector<char> s(n);
  rep(i, n) cin >> s.at(i);
  int cnt=0;
  rep(i, n-2){
    if(s.at(i)=="A"&&s.at(i+1)=="B"&&s.at(i+2)=="C") cnt++;
  }
  cout << cnt;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: 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") cnt++;
      |        ~~~~~~~^~~~~
a.cc:11:31: 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") cnt++;
      |                      ~~~~~~~~~^~~~~
a.cc:11:47: 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") cnt++;
      |                                      ~~~~~~~~~^~~~~
Language: C++

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

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


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") {
a.cc:11:30: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(s[i] == "A" && s[i+1] == "B" && s[i+2] == "C") {
a.cc:11:47: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(s[i] == "A" && s[i+1] == "B" && s[i+2] == "C") {
Language: C++

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

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


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") {
a.cc:11:30: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(s[i] == "A" && s[i+1] == "B" && s[i+2] == "C") {
a.cc:11:47: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(s[i] == "A" && s[i+1] == "B" && s[i+2] == "C") {
Language: C++

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

int main() {
  int n;
  cin >> n;
vector<string> s(n);
  int x=0;
  
  for (int i=0 ; i+2<n ; i++) 	{
    if (s.at(i)="A")	{
      if (s.at(i+1)="B")	{
        if (s.at(i+2)="C")	{x++;}
      }
    }
  }
  cout << x << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: could not convert '(& s.std::vector<std::__cxx11::basic_string<char> >::at(((std::vector<std::__cxx11::basic_string<char> >::size_type)i)))->std::__cxx11::basic_string<char>::operator=(((const char*)"A"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   11 |     if (s.at(i)="A")    {
      |         ~~~~~~~^~~~
      |                |
      |                std::__cxx11::basic_string<char>
a.cc:12:20: error: could not convert '(& s.std::vector<std::__cxx11::basic_string<char> >::at(((std::vector<std::__cxx11::basic_string<char> >::size_type)(i + 1))))->std::__cxx11::basic_string<char>::operator=(((const char*)"B"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   12 |       if (s.at(i+1)="B")        {
      |           ~~~~~~~~~^~~~
      |                    |
      |                    std::__cxx11::basic_string<char>
a.cc:13:22: error: could not convert '(& s.std::vector<std::__cxx11::basic_string<char> >::at(((std::vector<std::__cxx11::basic_string<char> >::size_type)(i + 2))))->std::__cxx11::basic_string<char>::operator=(((const char*)"C"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   13 |         if (s.at(i+2)="C")      {x++;}
      |             ~~~~~~~~~^~~~
      |                      |
      |                      std::__cxx11::basic_string<char>
Language: C++

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

int main() {
  int n;
  cin >> n;
vector<string> s(n);
  int x=0;
  
  for (int i=0 ; i+2<n ; i++) 	{
    if (s.at(i)="A")	{
      if (s.at(i+1)="B")	{
        if (s.at(i+2)="C")	{x++}
      }
    }
  }
  cout << x << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: could not convert '(& s.std::vector<std::__cxx11::basic_string<char> >::at(((std::vector<std::__cxx11::basic_string<char> >::size_type)i)))->std::__cxx11::basic_string<char>::operator=(((const char*)"A"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   11 |     if (s.at(i)="A")    {
      |         ~~~~~~~^~~~
      |                |
      |                std::__cxx11::basic_string<char>
a.cc:12:20: error: could not convert '(& s.std::vector<std::__cxx11::basic_string<char> >::at(((std::vector<std::__cxx11::basic_string<char> >::size_type)(i + 1))))->std::__cxx11::basic_string<char>::operator=(((const char*)"B"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   12 |       if (s.at(i+1)="B")        {
      |           ~~~~~~~~~^~~~
      |                    |
      |                    std::__cxx11::basic_string<char>
a.cc:13:22: error: could not convert '(& s.std::vector<std::__cxx11::basic_string<char> >::at(((std::vector<std::__cxx11::basic_string<char> >::size_type)(i + 2))))->std::__cxx11::basic_string<char>::operator=(((const char*)"C"))' from 'std::__cxx11::basic_string<char>' to 'bool'
   13 |         if (s.at(i+2)="C")      {x++}
      |             ~~~~~~~~~^~~~
      |                      |
      |                      std::__cxx11::basic_string<char>
a.cc:13:37: error: expected ';' before '}' token
   13 |         if (s.at(i+2)="C")      {x++}
      |                                     ^
      |                                     ;
Language: C++

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

int main(){
  int N;
  cin >> N;
  string S;
  cin >> S;
  
  int count=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'){
      count++;
    }
  }
  
  cout << count << endl;
}

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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n ;
  cin >> n;
  string s;
  cin >> s;
  int c = 0;
  for (int i = 0; i <=n; i++){
    if (s[i] == "ABC"){
      c++ } }
  cout << c ;

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |     if (s[i] == "ABC"){
a.cc:11:10: error: expected ';' before '}' token
   11 |       c++ } }
      |          ^~
      |          ;
a.cc:12:14: error: expected '}' at end of input
   12 |   cout << c ;
      |              ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

clude<bits/stdc++.h>
using namespace std;
int main(){
  int n ;
  cin >> n;
  string s;
  cin >> s;
  for (int i =0 ; i <=  n; i++) {
    if (s == "ABC") {
      cout << n; }
}  }

Compiler output:
a.cc:1:1: error: 'clude' does not name a type
    1 | clude<bits/stdc++.h>
      | ^~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> n;
      |   ^~~
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string s;
      |   ^~~~~~
a.cc:7:10: error: 's' was not declared in this scope
    7 |   cin >> s;
      |          ^
a.cc:10:7: error: 'cout' was not declared in this scope
   10 |       cout << n; }
      |       ^~~~
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main()
{
int n ;
cin >> n ;
int c = 0;
string s;
cin >> s;
for (int i =0;i < n-3 ;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:13:33: error: lvalue required as left operand of assignment
   13 |     if (s[i]='A' && s[i+1]= 'B' && s[i+2]='C'  )  {c++; }
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
  int n; cin>>n; string str; cin>>str; int ans=0;
  for(int i=0;i<l-2;i++)
    if(str[i]=='A' && str[i+1]=='B' && str[i+2]=='C') ans++;
  cout<<ans;
  return 0;
}

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

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

int main(){
  int n;
  std::cin >> n;
  string s;
  int count = 0;
  std::cin >> s;
  rep(i, n - 3){
    if(s.at(i) == A){
      if (s.at(i+1) == B) {
        if (s.at(i+2) == C) {
          count++;
        }
      }
    }
  }
  cout << count << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: 'A' was not declared in this scope
   12 |     if(s.at(i) == A){
      |                   ^
a.cc:13:24: error: 'B' was not declared in this scope
   13 |       if (s.at(i+1) == B) {
      |                        ^
a.cc:14:26: error: 'C' was not declared in this scope
   14 |         if (s.at(i+2) == C) {
      |                          ^
Language: C++

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

int main(){
  int n;
  std::cin >> n;
  string s;
  int count = 0;
  std::cin >> s;
  rep(i, n - 3){
    if(s.at(i) == "A"){
      if (s.at(i+1) == "B") {
        if (s.at(i+2) == "C") {
          count++;
        }
      }
    }
  }
  cout << count << endl;
  return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n,i;
    string s,count=0;
 // int i;
    for(i=0;i<n-2;i++){
        if(s[i]=='A' and s[i+1]=='B' and s[i+2]=='C')
            count++;
    }
    cout << count << endl;
    return 0;
}//

Compiler output:
a.cc: In function 'int main()':
a.cc:12:18: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   12 |             count++;
      |             ~~~~~^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n,i;
    string s,count=0;
    for(i=;i<n-2;i++){
        if(s[i]=='A' and s[i+1]=='B' and s[i+2]=='C')
            count++;
    }
    cout << count << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: expected primary-expression before ';' token
    9 |     for(i=;i<n-2;i++){
      |           ^
a.cc:11:18: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   11 |             count++;
      |             ~~~~~^~
Language: C++

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

int main(){
  string a;
  int k=0;
  cin >> a ;
  int i=1;

  for(i=0;i<=a.size()-3;i++){
    if(a.at(i)=='A' &&a.at(i+1)=='B'&&a.at(i+2)=='C')
    k +=1;

  }

cout << k <<endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:16:18: error: expected '}' at end of input
   16 | cout << k <<endl;
      |                  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG

using namespace std;
typedef long long ll;

#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REP(a, b, m) for (ll a = (ll)(b); a < (ll)(m); a++)

int main()
{
    int n;
    cin >> n;
    vector<char> s(n);
  rep(i,n){
    cin >> s[i];
  }
    int ans;
    rep(i, n)
    {
        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:21:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   21 |         if (s[i] == "A" && s[i + 1] == "B" && s[i + 2] == "C")
a.cc:21:37: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   21 |         if (s[i] == "A" && s[i + 1] == "B" && s[i + 2] == "C")
a.cc:21:56: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   21 |         if (s[i] == "A" && s[i + 1] == "B" && s[i + 2] == "C")
Language: C++

#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG

using namespace std;
typedef long long ll;

#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REP(a, b, m) for (ll a = (ll)(b); a < (ll)(m); a++)

int main()
{
    int n;
    cin >> n;
    string s;
    cin >> s;
    int ans;
    rep(i, n)
    {
        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:19:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   19 |         if (s[i] == "A" && s[i + 1] == "B" && s[i + 2] == "C")
a.cc:19:37: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   19 |         if (s[i] == "A" && s[i + 1] == "B" && s[i + 2] == "C")
a.cc:19:56: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   19 |         if (s[i] == "A" && s[i + 1] == "B" && s[i + 2] == "C")
Language: C++

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

int main(){
  string S;
  int ans=0;
  int N=S.size();
  vector<int>A(N);
  for(int i=0;i<N;i++){
    cin>>A[i];
  }
  for(int i=0;i<N;i++){
    if(A[i]=="A"&&A[i+1]=="B"&&A[i+2]=="C"){
      ans++;
    }
  }
  cout<<ans<<endl;
}


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

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
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:17:5: error: 'cout' does not name a type
   17 |     cout << count <<endl;
      |     ^~~~
a.cc:18:1: error: expected declaration before '}' token
   18 | }
      | ^
Language: C++

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

int main(){
    int N;
    string S;
    cin >> N >> S;
    
    int count = 0;
    rep(i,N){
        if(S.at(i) == 'A' && S.at(i+1) == 'B' && S.at(i+2) == 'C')
        count++;
        }
    }

    cout << count <<endl;
}

Compiler output:
a.cc:17:5: error: 'cout' does not name a type
   17 |     cout << count <<endl;
      |     ^~~~
a.cc:18:1: error: expected declaration before '}' token
   18 | }
      | ^
Language: C++

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		(new Scanner(System.in)).nextInt(); //just to skip the length
		String string = String.valueOf((new Scanner(System.in)).next());
		int count = 0;
		while(string.contains("ABC")) {
			string = string.replaceFirst("ABC","DEF");
			count += 1;
		}
		System.out.println(count);
	}
}


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

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

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

Compiler output:
a.cc:1:1: error: 'ude' does not name a type
    1 | ude <bits/stdc++.h>
      | ^~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string s;
      |   ^~~~~~
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin >> n >> s;
      |   ^~~
a.cc:7:15: error: 's' was not declared in this scope
    7 |   cin >> n >> s;
      |               ^
a.cc:15:3: error: 'cout' was not declared in this scope
   15 |   cout << k << endl;
      |   ^~~~
a.cc:15:16: error: 'endl' was not declared in this scope
   15 |   cout << k << endl;
      |                ^~~~
Language: C++

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

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


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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;}
const ll INF = 1LL<<60;
const ll M = 1000000007;
ll mpow(ll a,ll b){ll res=1;while(b!=0){if(b&1)res=res*a%M;a=a*a%M;b=b>>1;}return res;}
ll mcomb(ll n,ll k){if(k>n/2)return mcomb(n,n-k);ll res=1;for(ll i=0;i<k;i++){res=res*(n-i)%M;res=res*mpow(k-i,M-2)%M;}return res;}
/*template*/

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


Compiler output:
a.cc: In function 'int main()':
a.cc:17:34: error: expected ';' before '}' token
   17 |     if(s.substr(i,3)=="ABC")ans++
      |                                  ^
      |                                  ;
   18 |   }
      |   ~
Language: C++

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

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


Compiler output:
a.cc:15:3: error: 'cout' does not name a type
   15 |   cout << count << endl;
      |   ^~~~
a.cc:16:1: error: expected declaration before '}' token
   16 | }
      | ^
Language: C++

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

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


Compiler output:
a.cc:15:3: error: 'cout' does not name a type
   15 |   cout << count << endl;
      |   ^~~~
a.cc:16:1: error: expected declaration before '}' token
   16 | }
      | ^
Language: C++

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

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

  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:47: error: expected ')' before 'B'
   11 |     if (S.at(i) + S.at(i+1) + S.at(i+2) == 'A''B''C') {
      |        ~                                      ^~~
      |                                               )
Language: C++

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

int main() {
  int N;
  string S;
  cin >> S;
  int M = N-2;
  int count = 0;
  for (int i = 0; i < M; 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:11:41: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if (S.at(i) + S.at(i+1) + S.at(i+2) == "ABC") {
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Language: C++

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

int main() {
  int N;
  string S;
  cin >> S;
  int M = N-2;
  int count = 0;
  for (int i = 0; i < M; 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:11:16: error: expected ')' before 'S'
   11 |     if (S.at(i)S.at(i+1)S.at(i+2) == "ABC") {
      |        ~       ^
      |                )