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

#include <iostream>
using namepsace std;

int main()
{
  int n, count=0;
  cin >> n;
  for(int i=0; i<n; ++i)
  {
    string s;
    cin >> s[0];
  }
  for(int i=0; i<n; ++i)
  {
    if(str.substr(i, 3) == "ABC") count++;
  }
  cout << count << endl;
}


Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namepsace'
    2 | using namepsace std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin >> n;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:10:5: error: 'string' was not declared in this scope
   10 |     string s;
      |     ^~~~~~
a.cc:10:5: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:11:12: error: 's' was not declared in this scope
   11 |     cin >> s[0];
      |            ^
a.cc:15:8: error: 'str' was not declared in this scope; did you mean 'std'?
   15 |     if(str.substr(i, 3) == "ABC") count++;
      |        ^~~
      |        std
a.cc:17:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   17 |   cout << count << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:17:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   17 |   cout << count << endl;
      |                    ^~~~
      |                    std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
using namepsace std;

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

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namepsace'
    2 | using namepsace std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:19: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   int n, count=0; cin >> n;
      |                   ^~~
      |                   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:5: error: 'string' was not declared in this scope
    9 |     string s;
      |     ^~~~~~
a.cc:9:5: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:10:12: error: 's' was not declared in this scope
   10 |     cin >> s[0];
      |            ^
a.cc:14:8: error: 's' was not declared in this scope
   14 |     if(s.substr(i, 3) == "ABC") count++;
      |        ^
a.cc:16:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |   cout << count << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:16:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   16 |   cout << count << endl;
      |                    ^~~~
      |                    std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>

using namespace std;

int main()
{

int i; int counter=0;
char arr[50];
char arr2[3]="ABC";
int x;
cin >>x;
for(i=0;i<x;i++){cin>>arr[i];}
for(int j=0,i=0;j<x;j++){
        if(arr2[i] ==arr[j]  ){i++;}
        else {i=0;}
        if (i== 3){counter+=1;i=0;}}
cout<<counter<<endl;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: initializer-string for 'char [3]' is too long [-fpermissive]
   10 | char arr2[3]="ABC";
      |              ^~~~~
Language: Java


import java.util.Scanner;

public class A {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		
		sc.nextInt();
		
		String input = sc.next();
		String abc = "ABC";
		
		int count = 0;
		
		for(int i = 0; i < input.length() - abc.length(); i++) {
			if(input.substring(i, i + abc.length()).equals(abc)) {
				count++;
			}
		}
		
		System.out.println(count);
	}

}


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

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

int main()
{
int n;
string s;
cin>>n>>s;
int counter=0;
for(int i=0;i<s.size();i++){
    if(s[i]=='A'&&s[i+1]=='B'&&s[i+2]=='C'){
         counter++;
         i+=2A;
    }

}
cout<<counter;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: unable to find numeric literal operator 'operator""A'
   14 |          i+=2A;
      |             ^~
Language: C++

#include <iostream>

using namespace std;

int main()
{
  int n,c=0;
  char s[50];
  cin >>n;
  for(int i=0;i<n;i++){
    cin >>s[i];
  }
  for(int j=0;j<n;j++){
    if(s[i]=='a'&& s[i+1]=='b'&& s[i+2]=='c')
        c+=1;
    
  }
  cout << c;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: 'i' was not declared in this scope
   14 |     if(s[i]=='a'&& s[i+1]=='b'&& s[i+2]=='c')
      |          ^
Language: C++

#include <iostream>

using namespace std;

int main()
{
  int n,c=0;
  char s[50];
  cin >>n;
  for(int i=0;n>i;i++){
    cin >>s[i];
  }
  for(int j=0;n>j;j++){
    if(s[i]=='a'&&s[i+1]=='b'&&s[i+2]=='c'){
        c+=1;
    }
  }
  cout << c;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: 'i' was not declared in this scope
   14 |     if(s[i]=='a'&&s[i+1]=='b'&&s[i+2]=='c'){
      |          ^
Language: C++

#include <iostream>

using namespace std;

int main()
{
  int n,c=0;
  char s[50];
  cin >>n
  for(int i=0;n>i;i++){
    cin >>s[i];
  }
  for(int j=0;n>j,j++){
    if(s[i]=='a'&&s[i+1]=='b'&&s[i+2]=='c'){
        c+=1;
    }
  }
  cout << c;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: expected ';' before 'for'
    9 |   cin >>n
      |          ^
      |          ;
   10 |   for(int i=0;n>i;i++){
      |   ~~~     
a.cc:10:17: error: 'i' was not declared in this scope
   10 |   for(int i=0;n>i;i++){
      |                 ^
a.cc:13:22: error: expected ';' before ')' token
   13 |   for(int j=0;n>j,j++){
      |                      ^
      |                      ;
Language: C++

#include <iostream>

using namespace std;

int main()
{
  int n,c=0;
  char s[50];
  cin >>n
  for(int i=0;n>i;i++){
    cin >>s[i];
  }
  for(int i=0;n>i,i++){
    if(s[i]=='a'&&s[i+1]=='b'&&s[i+2]=='c'){
        c+=1;
    }
  }
  cout << c;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: expected ';' before 'for'
    9 |   cin >>n
      |          ^
      |          ;
   10 |   for(int i=0;n>i;i++){
      |   ~~~     
a.cc:10:17: error: 'i' was not declared in this scope
   10 |   for(int i=0;n>i;i++){
      |                 ^
a.cc:13:22: error: expected ';' before ')' token
   13 |   for(int i=0;n>i,i++){
      |                      ^
      |                      ;
Language: C++

#include <iostream>
#include <cctype>
#include <cstring>

using namespace std;

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

    }
    cout<<total;

    return 0;
}

Compiler output:
a.cc:21:5: error: 'cout' does not name a type
   21 |     cout<<total;
      |     ^~~~
a.cc:23:5: error: expected unqualified-id before 'return'
   23 |     return 0;
      |     ^~~~~~
a.cc:24:1: error: expected declaration before '}' token
   24 | }
      | ^
Language: C++

#include <iostream>
#include<string>
#include<cctype>
#include<cstring>
using namespace std;
int main()
{
int n,total,a;
total=0;
string s;
cin>>n;
cout<<endl;
cin>>s;
for(a=0;a+2<n;a++){
    if(((char)s[a]=="A")&&((char)s[a+1]=="B")&&((char)s[a+2]=="C")){
        total++;
        a=+2;}

}
cout<<total;
}




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

#include <iostream>
#include<string>
#include<cctype>
using namespace std;
int main()
{
int n,total,a;
total=a=0;
string s;
cin>>n;
cout<<endl;
cin>>s;
for(a;a<n;a++){
    if((char)s[a]=="A"){
        if((char)s[a+1]=="B")
            if((char)s[a+2]=="C")
                total++;
                a=+2;}

}
cout<<total;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:14:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |     if((char)s[a]=="A"){
      |        ~~~~~~~~~~^~~~~
a.cc:15:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |         if((char)s[a+1]=="B")
      |            ~~~~~~~~~~~~^~~~~
a.cc:16:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |             if((char)s[a+2]=="C")
      |                ~~~~~~~~~~~~^~~~~
Language: C++

#include <iostream>
#include<string>
#include<cctype>
using namespace std;
int main()
{
int n,total,a;
total=a=0;
string s;
cin>>n;
cout<<endl;
cin>>s;
for(a;a+2<n;a++){
    if(((char)s[a]=="A")&&((char)s[a+1]=="B")&&((char)s[a+2]=="C")){
        total++;
        a=+2;}

}
cout<<total;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:14:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |     if(((char)s[a]=="A")&&((char)s[a+1]=="B")&&((char)s[a+2]=="C")){
      |         ~~~~~~~~~~^~~~~
a.cc:14:40: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |     if(((char)s[a]=="A")&&((char)s[a+1]=="B")&&((char)s[a+2]=="C")){
      |                            ~~~~~~~~~~~~^~~~~
a.cc:14:61: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |     if(((char)s[a]=="A")&&((char)s[a+1]=="B")&&((char)s[a+2]=="C")){
      |                                                 ~~~~~~~~~~~~^~~~~
Language: C++

#include <iostream>
#include<string>
#include<cctype>
using namespace std;
int main()
{
int n,total,b,c;
total=b=c=0;
string s;
cin>>n;
cout<<endl;
cin>>s;
for(int a=0;a<n;a++){
    if(((char)s[a]=="A")&&((char)s[b+1]=="B")&&((char)s[c+2]=="C")){
        total++;
        a=+2;}

}
cout<<total;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:14:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |     if(((char)s[a]=="A")&&((char)s[b+1]=="B")&&((char)s[c+2]=="C")){
      |         ~~~~~~~~~~^~~~~
a.cc:14:40: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |     if(((char)s[a]=="A")&&((char)s[b+1]=="B")&&((char)s[c+2]=="C")){
      |                            ~~~~~~~~~~~~^~~~~
a.cc:14:61: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |     if(((char)s[a]=="A")&&((char)s[b+1]=="B")&&((char)s[c+2]=="C")){
      |                                                 ~~~~~~~~~~~~^~~~~
Language: C++

#include <iostream>
#include<string>
#include<cctype>
using namespace std;
int main()
{
int n,total;
total=b=c=0;
string s;
cin>>n;
cout<<endl;
cin>>s;
for(int a=0;a<n;a++){
    if(((char)s[a]=="A")&&((char)s[b+1]=="B")&&((char)s[c+2]=="C")){
        total++;
        a=+2;}

}
cout<<total;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'b' was not declared in this scope
    8 | total=b=c=0;
      |       ^
a.cc:8:9: error: 'c' was not declared in this scope
    8 | total=b=c=0;
      |         ^
a.cc:14:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |     if(((char)s[a]=="A")&&((char)s[b+1]=="B")&&((char)s[c+2]=="C")){
      |         ~~~~~~~~~~^~~~~
Language: C++

#include <iostream>
#include<string>
#include<cctype>
using namespace std;
int main()
{
int n,total;
total=0;
string s;
cin>>n;
cout<<endl;
cin>>s;
for(int a=0;a<n;a++){
    if(((char)s[a]=="A")&&((char)s[b+1]=="B")&&((char)s[c+2]=="C")){
        total++;
        a=+2;}

}
cout<<total;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:14:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |     if(((char)s[a]=="A")&&((char)s[b+1]=="B")&&((char)s[c+2]=="C")){
      |         ~~~~~~~~~~^~~~~
a.cc:14:36: error: 'b' was not declared in this scope
   14 |     if(((char)s[a]=="A")&&((char)s[b+1]=="B")&&((char)s[c+2]=="C")){
      |                                    ^
a.cc:14:57: error: 'c' was not declared in this scope
   14 |     if(((char)s[a]=="A")&&((char)s[b+1]=="B")&&((char)s[c+2]=="C")){
      |                                                         ^
Language: C++

#include <iostream>
#include<string>
#include<cctype>
using namespace std;
int main()
{
int n,total;
total=0;
string s;
cin>>n;
cout<<emdl;
cin>>s;
for(int a=0;a<n;a++){
    if(((char)s[a]=="A")&&((char)s[b+1]=="B")&&((char)s[c+2]=="C")){
        total++;
        a=+2;}

}
cout<<total;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: 'emdl' was not declared in this scope
   11 | cout<<emdl;
      |       ^~~~
a.cc:14:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |     if(((char)s[a]=="A")&&((char)s[b+1]=="B")&&((char)s[c+2]=="C")){
      |         ~~~~~~~~~~^~~~~
a.cc:14:36: error: 'b' was not declared in this scope
   14 |     if(((char)s[a]=="A")&&((char)s[b+1]=="B")&&((char)s[c+2]=="C")){
      |                                    ^
a.cc:14:57: error: 'c' was not declared in this scope
   14 |     if(((char)s[a]=="A")&&((char)s[b+1]=="B")&&((char)s[c+2]=="C")){
      |                                                         ^
Language: C++

#include <iostream>

using namespace std;
int main(){
        int N,c=0;
        char S[50];
        cin>>N;
        for(int i=0;i<N;i++)
            cin>>S[i];
        for(int i=0;i<N;i++){
            if(S[i]=='A'&& S[i+1]=='B'&& S[i+2]=='C' )
                c+=1;

        }
        cout<<c;

    return 0;

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

int main(){ int n,c=0;
        char A[50];
        cin>>n;
        for(int i=0;i<n-1;i++)
            cin>>A[i];
        for(int i=0;i<n-1;i++){
            if(A[i]=='A'&& A[i+1]=='B'&&A[i+2]=='C' )
                c+=1;

        }
        cout<<c;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'cin' was not declared in this scope
    3 |         cin>>n;
      |         ^~~
a.cc:11:9: error: 'cout' was not declared in this scope
   11 |         cout<<c;
      |         ^~~~
Language: Java

package atCoder;

import java.util.Scanner;

public class abc150_b {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s = sc.next();

        String[] str = s.split("ABC");

        System.out.println(str.length - 1);

    }
}


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

#include<stdio.h>
int main(){
    int i=0,n,cnt=0;
    scanf("%d",&n);
    char c[n];
    scanf("%s",c);
    while (i+2<n)
    { 
        if(c[i]=='A' and c[i+1]=='B' and c[i+2]=='C'){
            cnt++;
        }
        i++;
    }
    printf("%d",cnt);
    return 0;   
}

Compiler output:
main.c: In function 'main':
main.c:9:21: error: expected ')' before 'and'
    9 |         if(c[i]=='A' and c[i+1]=='B' and c[i+2]=='C'){
      |           ~         ^~~~
      |                     )
Language: C

#include<stdio.h>
int main(){
    int i=0,n,cnt=0;
    scanf("%d",&n);
    char c[n];
    for(i=0;i<n;i++){
    scanf("%c",&c[i]);}
    int t=0;int j=65;
    i=0;
    char ans[3] = {'A','B','C'}; 

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

    
}

Compiler output:
main.c: In function 'main':
main.c:14:21: error: expected ')' before 'and'
   14 |         if(c[i]=='A' and c[i+1]=='B' and c[i+2]=='C'){
      |           ~         ^~~~
      |                     )
Language: C++

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        int N = Integer.parseInt((new Scanner(System.in)).nextLine());
        String string = (new Scanner(System.in)).nextLine();
        int count = 0;
        for (int i = 0; i < string.length()-2; i++) {
            if (string.toLowerCase().charAt(i) == 'A' && string.toLowerCase().charAt(i+1) == 'B' && string.toLowerCase().charAt(i+2) == 'C') {
                count++;
            }
        }
        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++

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

int f(const char *s)
{
 int n = 0;
 for(int i = 0; i < strlen(s) - 2; i++)
 {
  if(s[i] == 'A' && s[i+1] == 'B' && s[i+2] == 'C')
   n++;
 }
 return n;
}

int main()
{
 int n;
 scanf("%d", &n);
 scanf(" ");
 char s[n + 1];
 gets(s);
 printf("%d\n", f(s));
}

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

#include <bits/stdc++.h>
#include <iostream>
#include <map>
#include <vector>
#include <cmath>
#include <ios>
#include <iomanip>
#include <algorithm>
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define REP2(i, m, n) for (int i = (m); i < (int)(n); ++i)
#define REPR(i, n) for (int i = (n)-1; i >= 0; --i)
#define REPR2(i, m, n) for (int i = (n)-1; i >= (m); --i)
#define REPx(x, a) for(auto x : a)
#define ALL(a) a.begin(), a.end()
#define SORT(a) sort(ALL(a))
#define SORTR(a) sort(ALL(a), greater<int>())
#define REVERSE(a) reverse(ALL(a))
#define bit_search(bit, n) REP(bit, 1<<(n))
#define bit_check(bit, i) (bit>>(i)) & 1
#define setpre(n) fixed << setprecision((n))
#define UNIQUE(a) do {SORT(a); (a).erase(unique(ALL(a)), (a).end());} while(0)
#define MAX(a) *max_element(ALL(a))
#define MIN(a) *min_element(ALL(a))
#define bisect_left(a, x) lower_bound(ALL(a), (x)) - a.begin()
#define bisect_right(a, x) upper_bound(ALL(a), (x)) - a.begin()
#define INPUT(a) REP(i, a.size()) cin >> a[i];
#define INPUTP(a) REP(i, a.size()) cin >> a[i].first >> a[i].second;
#define ENDL cout << endl;
using namespace std;
using LL = long long;
using LD = long double;
using PII = pair<int, int>;
using VPII = vector<PII>;
using PLL = pair<LL, LL>;
using VPLL = vector<PLL>;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VC = vector<char>;
using VS = vector<string>;
using VB = vector<bool>;
using VD = vector<double>;
const LL INF = 1e18;
const LL MOD = 1e9 + 7;

template<class T> inline bool chmin(T &a, T b){if (a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T &a, T b){if (a < b) {a = b; return true;} return false;}

void END(){cout << 1 << endl; exit(0);}

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, ans = 0;
  string s;
  cin >> n >> s;
  REP(i, n-2) if ("ABC" == s[i] + s[i+1] + s[i+2]) ans++;
  cout << ans << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:59:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   59 |   REP(i, n-2) if ("ABC" == s[i] + s[i+1] + s[i+2]) ans++;
Language: C++

#include <iostream>
#include <cctype>
#include <cstring>

using namespace std;

int main()
{
    int N,i,cou=0;
    string S;
    cin>>N;
    cout<<endl;
    cin>>S;
   if(N>=3&&N<=50){
        for(i=0;i<N;i++){
            S[i]=toupper(S[i]);}
    for(i=0;i<N; i++) {
    if((char)S[i]=='A')&&((char)S[i+1]=='B')&&((char)S[i+2]=='C')){
                cou++;
                i=i+3;
            }}

    }
    cout<<cou;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:26: error: expected identifier before '(' token
   18 |     if((char)S[i]=='A')&&((char)S[i+1]=='B')&&((char)S[i+2]=='C')){
      |                          ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <stdio.h>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |         if (s[i]=="A" && s[i+1] == "B" && s[i+2] == "C")
a.cc:15:33: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |         if (s[i]=="A" && s[i+1] == "B" && s[i+2] == "C")
a.cc:15:50: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |         if (s[i]=="A" && s[i+1] == "B" && s[i+2] == "C")
a.cc:16:16: error: expected ';' before '}' token
   16 |             z++
      |                ^
      |                ;
   17 | 
   18 |     }
      |     ~
Language: C++

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

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

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

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

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

#include <iostream>
#include <cstring>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <stdio.h>
#include <cmath>
#include <string.h>
#include <vector>

#define ll long long
#define inf 0x3f3f3f3f
using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    string s;
    int n;
    int cnt = 0;
    cin >> n >> s;
    while(i < n -1)
    {
      if(s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C')
      {
            cnt++;
            i+=3;
      }
      else i++;
    }
    cout << cnt << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:11: error: 'i' was not declared in this scope
   23 |     while(i < n -1)
      |           ^
Language: C++

#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define RFOR(i, a, b) for (int i = (a); i >= (b); i--)
#define LFOR(i, a, b) for (long long int i = (a); i <= (b); i++)
#define LRFOR(i, a, b) for (long long int i = (a); i >= (b); i--)
#define MOD 1000000007
#define INF 1000000000           // 2000000000
#define LINF 1000000000000000000 // 9000000000000000000
#define DINF 1000000000000000.0
#define PI 3.14159265358979

//.size()はunsigned int　0-1をするとオーバーフローする

using namespace std;
typedef long long int ll;
typedef pair<long long int, long long int> P;

int dy[5] = {-1, 0, 1, 0, 0};
int dx[5] = {0, -1, 0, 1, 0};

int main(void) {
    int n;
    string s;
    int count=0;

    cin>>n>>s;

    FOR(i,0,n-3){
        if(s[i]=='A'&&s[i+1]=='B'&&s[i+2]=='C'){
            coutn++;
        }
    }
    cout<<count<<endl;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:13: error: 'coutn' was not declared in this scope; did you mean 'count'?
   30 |             coutn++;
      |             ^~~~~
      |             count
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<string> data(N);
  for (int i = 0; i < N; i++) {
    cin >> data.at(i);
  }

  // dataの中で隣り合う等しい要素が存在するなら"YES"を出力し、そうでなければ"NO"を出力する
  // ここにプログラムを追記
  int count = 0;
  for (int i = 0; i < N - 2; i++) {
    if (data.at(i) == A && (data.at(i+1) == B && data.at(i+2) == C)) {
      count++;
    }
  }
    
  cout << count <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:23: error: 'A' was not declared in this scope
   16 |     if (data.at(i) == A && (data.at(i+1) == B && data.at(i+2) == C)) {
      |                       ^
a.cc:16:45: error: 'B' was not declared in this scope
   16 |     if (data.at(i) == A && (data.at(i+1) == B && data.at(i+2) == C)) {
      |                                             ^
a.cc:16:66: error: 'C' was not declared in this scope
   16 |     if (data.at(i) == A && (data.at(i+1) == B && data.at(i+2) == C)) {
      |                                                                  ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: expected ';' before 'string'
    7 |         cin >> n
      |                 ^
      |                 ;
    8 | 
    9 |         string s;
      |         ~~~~~~   
a.cc:10:16: error: 's' was not declared in this scope
   10 |         cin >> s;
      |                ^
Language: C++

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

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

#include <vector>
#include <algorithm>
#include <string>
using namespace std;

int main() {
    int N;
    int count=0;
    cin >> N;

    string S;
    cin >> S;

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

    cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'cin' was not declared in this scope
    9 |     cin >> N;
      |     ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include <string>
  +++ |+#include <iostream>
    4 | using namespace std;
a.cc:19:5: error: 'cout' was not declared in this scope
   19 |     cout << count << endl;
      |     ^~~~
a.cc:19:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:19:22: error: 'endl' was not declared in this scope
   19 |     cout << count << endl;
      |                      ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include <string>
  +++ |+#include <ostream>
    4 | using namespace std;
Language: C++


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

vector<int> func_vec(const string str, const string substr) {
    vector<int> result;

    int substrsize = substr.size();
    int pos = str.find(substr);

    while (pos != string::npos) {
        //Appendしていく
        result.push_back(pos);
        //文字検索位置を更新する
        pos = str.find(substr, pos + substrsize); 
    }
    return result;
}

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

    vector<int> vec = func_vec(str, substr);
    cout << vec.size()<< endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:37: error: 'substr' was not declared in this scope
   27 |     vector<int> vec = func_vec(str, substr);
      |                                     ^~~~~~
Language: C++

#include <iostream>
using namespace std;

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

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

#include <stdio.h>
int main(){
    int N;
    char s[51];
    scanf("%d",&N);
    int i,count;
    count=0;
    for(i =0;i<N;i++){
        scanf("%c",&s[i]);
    }
    for(i=0;i<N-2;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:12:61: error: expected ')' before '{' token
   12 |         if((s[i]=='A') && (s[i+1] == 'B') && (s[i+2] == 'C'){
      |           ~                                                 ^
      |                                                             )
main.c:15:5: error: expected expression before '}' token
   15 |     }
      |     ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

const int maxn=1e4+5;

typedef long long ll;

const ll mod=1e9+7;

char s[maxn];

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

Compiler output:
a.cc: In function 'int main()':
a.cc:19:20: error: 'a' was not declared in this scope
   19 |                 if(a[i-1]=='A'&&a[i]=='B'&&a[i+1]=='C') ans++;
      |                    ^
Language: C++

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

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

      

Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: 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:30: 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:47: 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 <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:19: 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

package practice;

import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.util.Stack;




public class ROUGH{
	public static class FastReader {
		BufferedReader br;
		StringTokenizer root;
		
 
		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
 
		String next() {
			while (root == null || !root.hasMoreTokens()) {
				try {
					root = new StringTokenizer(br.readLine());
				} catch (Exception r) {
					r.printStackTrace();
				}
			}
			return root.nextToken();
		}
 
		int nextInt() {
			return Integer.parseInt(next());
		}
 
		double nextDouble() {
			return Double.parseDouble(next());
		}
 
		long nextLong() {
			return Long.parseLong(next());
		}
 
		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (Exception r) {
				r.printStackTrace();
			}
			return str;
		}
	}
	
	public static PrintWriter out = new PrintWriter (new BufferedOutputStream(System.out));
	static int mod = (int) (1e9+7);
	static long cf = 998244353;
    static final int N = (int) 1e3+10;
    public static List<Integer>[] edges;
    public static int[][] parent;
    public static int col = 20;
    public static int[] Bit;
    public static long[] fact,inv;
    public  static int[] prime; 
	public static Map<Integer, Integer> map; 
	static char ch = 'z';
	static FastReader sc = new FastReader();
	public static void main(String[] args) {
	//	Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String s = sc.next();
		int ans = (n - s.replace("ABC","").length())/3;
		out.print(ans);
		out.close();
	}
	
}


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

int main(){
  char c;
  int a=0;
  char f;
  while((c=getchar())!=10){
    if(c=='a'){
      f='a';
    }else if(c=='b'){
      if(f=='a') f='b';
    }else if(c=='c'){
      if(f=='b'){f=0; a++}
    }else{
      f=0;
    }
  }
  printf("%d\n", a);
}

Compiler output:
main.c: In function 'main':
main.c:5:12: error: implicit declaration of function 'getchar' [-Wimplicit-function-declaration]
    5 |   while((c=getchar())!=10){
      |            ^~~~~~~
main.c:1:1: note: 'getchar' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
  +++ |+#include <stdio.h>
    1 | int main(){
main.c:11:26: error: expected ';' before '}' token
   11 |       if(f=='b'){f=0; a++}
      |                          ^
      |                          ;
main.c:16:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   16 |   printf("%d\n", a);
      |   ^~~~~~
main.c:16:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:16:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:16:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

import java.util.*;

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

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
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++

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

int main() {
  int N;
  int count;
  string S;
  cin >> N >> S;
  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:10:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |     if(S.at(i) == "A" && S.at(i+1) == "B" && S.at(i+2) == "C"){
      |        ~~~~~~~~^~~~~~
a.cc:10:36: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |     if(S.at(i) == "A" && S.at(i+1) == "B" && S.at(i+2) == "C"){
      |                          ~~~~~~~~~~^~~~~~
a.cc:10:56: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |     if(S.at(i) == "A" && S.at(i+1) == "B" && S.at(i+2) == "C"){
      |                                              ~~~~~~~~~~^~~~~~
Language: C++

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

int main() {
  int N;
  int count;
  string S;
  cin >> N >> S;
  for(int i = 0; i < N ; 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:10:19: error: 'A' was not declared in this scope
   10 |     if(S.at(i) == A && S.at(i+1) == B && S.at(i+2) == C){
      |                   ^
a.cc:10:37: error: 'B' was not declared in this scope
   10 |     if(S.at(i) == A && S.at(i+1) == B && S.at(i+2) == C){
      |                                     ^
a.cc:10:55: error: 'C' was not declared in this scope
   10 |     if(S.at(i) == A && S.at(i+1) == B && S.at(i+2) == C){
      |                                                       ^
Language: C++

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

long long N=0,K=0,M=0,A=0,ansac=0,answa=0,p=0;
string S;
int main(){
    cin >> N >> S;
    for(i=0;i<N-2;i++){
        if(S.substr(i,i+2)=="ABC") ans++;
    }
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'i' was not declared in this scope
   10 |     for(i=0;i<N-2;i++){
      |         ^
a.cc:11:36: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |         if(S.substr(i,i+2)=="ABC") ans++;
      |                                    ^~~
      |                                    abs
a.cc:13:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C

#include <stdio.h>

int main(void) {
  /* code */
  int i,n;
  int ans = 0;
  scanf("%d", &n);
  char s[n+1]= {0};
  scanf("%s\n",s);
  for (i = 0; i < n-2; i++) {
    if(s[i] == 'A'){
      if(s[i+1] == 'B' && s[i+2] =='C'){
        ans++;
      }
    }
    /* code */
  }

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

Compiler output:
main.c: In function 'main':
main.c:8:16: error: variable-sized object may not be initialized except with an empty initializer
    8 |   char s[n+1]= {0};
      |                ^
Language: C

#include <stdio.h>

int main(void) {
  /* code */
  int i,n;
  int ans = 0;
  scanf("%d", &n);
  char s[n+1]
  scanf("%s\n",s);
  for (i = 0; i < n-2; i++) {
    if(s[i] == 'A'){
      if(s[i+1] == 'B' && s[i+2] =='C'){
        ans++;
      }
    }
    /* code */
  }

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

Compiler output:
main.c: In function 'main':
main.c:9:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanf'
    9 |   scanf("%s\n",s);
      |   ^~~~~
main.c:9:16: error: 's' undeclared (first use in this function)
    9 |   scanf("%s\n",s);
      |                ^
main.c:9:16: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

/*
                                Author: Ankit Kaul
**********************Code Belongs to Respective Author Only************************************
*/
 
/*#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")*/
 
#include <bits/stdc++.h>
 
#define endl       '\n'
#define PI          3.141592653589
#define jaldi       ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define M           1000000007
#define int         long long int
#define inf         INT_MAX
#define pb          emplace_back
#define pf          emplace_front
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define rall(a)     (a).rbegin(),(a).rend()
using namespace std;
 
int gcd(int a,int b) { return b == 0 ? a : gcd(b, a % b); }
int power(int x,int n){
    int result=1;
    while(n>0)
    {
        if(n % 2 ==1)
            result=(result * x) % M;
        x=(x*x)% M;
        n=n/2;
    }
    return result % M;
}
signed main()
{   jaldi
	int n;
	cin>>n;
	string str;
	cin>>str;
	int count=0;
	for(i=0;i<n-2;i++)
	{	if(str[i]=='A' && str[i+1]=='B' && str[i+2]=='C')
		count++;
	}
	cout<<count;

}

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

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

int main() {
  int N=0;
  string word;
  
  cin >> N;
  cin >> word;
  
  int counter = 0;
  
  for(int i=0; i<N; i++) {
    
    if(word.at(i, i+3) == 'ABC') {
      
      counter++;
      
    }
    
  }
  
  cout << counter << endl;
  
}

Compiler output:
a.cc:15:27: warning: multi-character character constant [-Wmultichar]
   15 |     if(word.at(i, i+3) == 'ABC') {
      |                           ^~~~~
a.cc: In function 'int main()':
a.cc:15:15: error: no matching function for call to 'std::__cxx11::basic_string<char>::at(int&, int)'
   15 |     if(word.at(i, i+3) == 'ABC') {
      |        ~~~~~~~^~~~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1287:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::at(size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; const_reference = const char&; size_type = long unsigned int]'
 1287 |       at(size_type __n) const
      |       ^~
/usr/include/c++/14/bits/basic_string.h:1287:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/basic_string.h:1309:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::at(size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; reference = char&; size_type = long unsigned int]'
 1309 |       at(size_type __n)
      |       ^~
/usr/include/c++/14/bits/basic_string.h:1309:7: note:   candidate expects 1 argument, 2 provided
Language: C++

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

int main() {
  
  string word;
  
  cin >> word;
  
  int counter = 0;
  
  for(int i=0; i<word.size(); i++) {
    
    if(word.at(i) == "ABC") {
      
      counter++;
      
    }
    
  }
  
  cout << counter << endl;
  
}

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

#include<iostream>
#include<string>
using namespace std;
int main(){
int N;
string S;
int count=0;
for(int p=0;p<N-1;p++){
if(S[p]=="A"&&S[p+1]=="B"&&S[p+2]=="C"){
  count++;
}
}
cout<<count<<endl;
}
 

Compiler output:
a.cc: In function 'int main()':
a.cc:9:8: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 | if(S[p]=="A"&&S[p+1]=="B"&&S[p+2]=="C"){
a.cc:9:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 | if(S[p]=="A"&&S[p+1]=="B"&&S[p+2]=="C"){
a.cc:9:34: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 | if(S[p]=="A"&&S[p+1]=="B"&&S[p+2]=="C"){
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
int N;
string S;
int count=0;
for(int p=0;p<N-1;p++){
if(S[p]==A&&S[p+1]==B&&S[p+2]==C){
  count++;
}
}
cout<<count<<endl;
}
 

Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: 'A' was not declared in this scope
    9 | if(S[p]==A&&S[p+1]==B&&S[p+2]==C){
      |          ^
a.cc:9:21: error: 'B' was not declared in this scope
    9 | if(S[p]==A&&S[p+1]==B&&S[p+2]==C){
      |                     ^
a.cc:9:32: error: 'C' was not declared in this scope
    9 | if(S[p]==A&&S[p+1]==B&&S[p+2]==C){
      |                                ^