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

import java.util.*;
public class main {
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      	
      	int n = sc.nextInt();
      	String s = sc.next();
      	String ref = "ABC";
      	int sum = 0;
      
      	for (int i = 0; i + 2 < n; i++){
        	if (ref.equals(s.substring(i, i+3)))
            	sum++;
        }
      	
      	System.out.println(sum);
    }
}

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

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

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

#include<iostream>
#include<string>
using namespace std;
int main(){
  int a;
  cin>>a;
  string s;
  cin>>s;
  int count=0;
  int n=0;
  while(count<a-3){
    string S=s[count]+s[count+1]+s[count+2];
    if(S=="ABC"){
      n++;
    }
    count++;
  }
  cout<<n<<endl;
  return 0;
  }

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: lvalue required as left operand of assignment
    9 | if(S.at(i)='A' & S.at(i+1) ='B'){
      |            ~~~~^~~~~~~~~~~
Language: C++

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

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

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

N=int(input())
s=input()
n=len(s)
ans=0
for i in range(n-2):
	if((s[i]=='A') and (s[i+1]=='B') and (s[i+2]=='C')):
		ans+=1
print(ans)

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N=int(input())
      | ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: lvalue required as left operand of assignment
   10 | if(S.at(i)=A & S.at(i+1) =B){
      |            ~~^~~~~~~~~~~
Language: C++

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

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

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

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

  int ans = 0;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:19: error: 'A' was not declared in this scope
   15 |     if(s.at(i) == A || s.at(i) == B || s.at(i) == C ) {
      |                   ^
a.cc:15:35: error: 'B' was not declared in this scope
   15 |     if(s.at(i) == A || s.at(i) == B || s.at(i) == C ) {
      |                                   ^
a.cc:15:51: error: 'C' was not declared in this scope
   15 |     if(s.at(i) == A || s.at(i) == B || s.at(i) == C ) {
      |                                                   ^
Language: C

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

Compiler output:
main.c:2:9: error: expected ';' before 'void'
    2 | int main void(){
      |         ^~~~~
      |         ;
main.c:2:15: error: expected identifier or '(' before ')' token
    2 | int main void(){
      |               ^
Language: C++

N=input()
s=input()
n=len(s)
ans=0
for i in range(n-2):
	if((s[i]=='A') and (s[i+1]=='B') and (s[i+2]=='C')):
		ans+=1
print(ans)

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N=input()
      | ^
Language: C++

n=int(input())
s=input()
ans=0
for i in range(n-2):
	if((s[i]=='A') and (s[i+1]=='B') and (s[i+2]=='C')):
		ans+=1
print(ans)

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n=int(input())
      | ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: 'A' was not declared in this scope
    8 | if(S.at(i)=A & S.at(i+1) =B){
      |            ^
a.cc:8:27: error: 'B' was not declared in this scope
    8 | if(S.at(i)=A & S.at(i+1) =B){
      |                           ^
a.cc:9:14: error: 'C' was not declared in this scope
    9 | if(S.at(i+2)=C){
      |              ^
a.cc:10:4: error: expected ';' before '}' token
   10 | r++
      |    ^
      |    ;
   11 | }
      | ~
Language: C++

#include<bits/std++.h>
using namespace std;
int main()
{
  string str,s;
  getline(cin,str);
  getline(cin,s);
  int t=s.length(),c=0;
  for(int i=0;i<t-2;i++)
  {
    for(int j=i+1;j<t-1;j++)
    {
      for(int k=0;k<t;k++)
      {
        if(s[i]=='A' && s[j]=='B' && s[k]=='C')
        {
          c++;
        }
      }
    }
  }
  cout<<c;
  return 0;
}
  

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

#include<stdio.h>
int main void(){
int n,i,f;
char s[50];
scanf(“%d”, &n);
scanf(“%s”, s);
for(i=0;i<n;i++){
if(s[i]==‘A’&&s[i+1]==‘B’&&s[i+2]==‘C’){
f++;
}
}
printf(“%d\n”, f);
return 0;
}

Compiler output:
main.c:2:9: error: expected ';' before 'void'
    2 | int main void(){
      |         ^~~~~
      |         ;
main.c:2:15: error: expected identifier or '(' before ')' token
    2 | int main void(){
      |               ^
main.c:5:7: error: stray '\342' in program
    5 | scanf(<U+201C>%d<U+201D>, &n);
      |       ^~~~~~~~
main.c:5:10: error: stray '\342' in program
    5 | scanf(<U+201C>%d<U+201D>, &n);
      |                 ^~~~~~~~
main.c:6:7: error: stray '\342' in program
    6 | scanf(<U+201C>%s<U+201D>, s);
      |       ^~~~~~~~
main.c:6:10: error: stray '\342' in program
    6 | scanf(<U+201C>%s<U+201D>, s);
      |                 ^~~~~~~~
main.c:8:10: error: stray '\342' in program
    8 | if(s[i]==<U+2018>A<U+2019>&&s[i+1]==<U+2018>B<U+2019>&&s[i+2]==<U+2018>C<U+2019>){
      |          ^~~~~~~~
main.c:8:12: error: stray '\342' in program
    8 | if(s[i]==<U+2018>A<U+2019>&&s[i+1]==<U+2018>B<U+2019>&&s[i+2]==<U+2018>C<U+2019>){
      |                   ^~~~~~~~
main.c:8:23: error: stray '\342' in program
    8 | if(s[i]==<U+2018>A<U+2019>&&s[i+1]==<U+2018>B<U+2019>&&s[i+2]==<U+2018>C<U+2019>){
      |                                     ^~~~~~~~
main.c:8:25: error: stray '\342' in program
    8 | if(s[i]==<U+2018>A<U+2019>&&s[i+1]==<U+2018>B<U+2019>&&s[i+2]==<U+2018>C<U+2019>){
      |                                              ^~~~~~~~
main.c:8:36: error: stray '\342' in program
    8 | if(s[i]==<U+2018>A<U+2019>&&s[i+1]==<U+2018>B<U+2019>&&s[i+2]==<U+2018>C<U+2019>){
      |                                                                ^~~~~~~~
main.c:8:38: error: stray '\342' in program
    8 | if(s[i]==<U+2018>A<U+2019>&&s[i+1]==<U+2018>B<U+2019>&&s[i+2]==<U+2018>C<U+2019>){
      |                                                                         ^~~~~~~~
main.c:12:8: error: stray '\342' in program
   12 | printf(<U+201C>%d\n<U+201D>, f);
      |        ^~~~~~~~
main.c:12:11: error: stray '\' in program
   12 | printf(“%d\n”, f);
      |           ^
main.c:12:13: error: stray '\342' in program
   12 | printf(<U+201C>%d\n<U+201D>, f);
      |                    ^~~~~~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:33: error: expected ')' before 'ands'
   12 |     if(s[i]=='A' and s[i+1]=='B' ands[i+2]=='C')
      |       ~                         ^~~~~
      |                                 )
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: 'A' was not declared in this scope
    8 | if(S.at(i)=A & S.at(i+1) =B){
      |            ^
a.cc:8:27: error: 'B' was not declared in this scope
    8 | if(S.at(i)=A & S.at(i+1) =B){
      |                           ^
a.cc:9:14: error: 'C' was not declared in this scope
    9 | if(S.at(i+2)=C){
      |              ^
a.cc:10:4: error: expected ';' before '}' token
   10 | r++
      |    ^
      |    ;
   11 | }
      | ~   
a.cc:14:4: error: expected '}' at end of input
   14 |   }
      |    ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

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

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

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

#define ll long long 
#define pi  pair<int,int>
#define ti  tuple<int,int,int>
#define mt  make_tuple
#define mk  make_pair
#define vi  vector<int>
#define vll vector<ll>
#define fastInOut ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pr(a) for(auto x:a) cout<<x<<" ";
#define prmap(m) for(auto x:m) cout<<x.first<<" "<<x.second<<"\n";


ll n,m;
int main() {
    fastInOut
    
    
    ll k,x;

   cin>>k;
    string s;
   cin>>s;
   int c=0;
   for(int i=0;i<k;i++){
     if(s[i]=='A'&&s[i+1]=='B'&&s[i+2]=='C'){
         c++;
         i++;
      }
   }
     cout<<c;
  /*  cin>>k>>x;
    if(k*500>=x)
          cout<<"Yes";
    else 
          cout<<"NO";
    */

  return 0;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include<bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include<bits/stdc++.h>
        ^
Main.java:4: error: illegal character: '#'
#define ll long long 
^
Main.java:4: error: class, interface, enum, or record expected
#define ll long long 
        ^
Main.java:5: error: illegal character: '#'
#define pi  pair<int,int>
^
Main.java:6: error: illegal character: '#'
#define ti  tuple<int,int,int>
^
Main.java:7: error: illegal character: '#'
#define mt  make_tuple
^
Main.java:8: error: illegal character: '#'
#define mk  make_pair
^
Main.java:9: error: illegal character: '#'
#define vi  vector<int>
^
Main.java:10: error: illegal character: '#'
#define vll vector<ll>
^
Main.java:11: error: illegal character: '#'
#define fastInOut ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
^
Main.java:11: error: class, interface, enum, or record expected
#define fastInOut ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
                                                   ^
Main.java:11: error: class, interface, enum, or record expected
#define fastInOut ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
                                                              ^
Main.java:12: error: illegal character: '#'
#define pr(a) for(auto x:a) cout<<x<<" ";
^
Main.java:12: error: class, interface, enum, or record expected
#define pr(a) for(auto x:a) cout<<x<<" ";
        ^
Main.java:13: error: illegal character: '#'
#define prmap(m) for(auto x:m) cout<<x.first<<" "<<x.second<<"\n";
^
Main.java:13: error: class, interface, enum, or record expected
#define prmap(m) for(auto x:m) cout<<x.first<<" "<<x.second<<"\n";
        ^
Main.java:16: error: class, interface, enum, or record expected
ll n,m;
^
Main.java:21: error: not a statement
    ll k,x;
       ^
Main.java:21: error: not a statement
    ll k,x;
         ^
Main.java:23: error: not a statement
   cin>>k;
      ^
Main.java:25: error: not a statement
   cin>>s;
      ^
Main.java:33: error: not a statement
     cout<<c;
         ^
Main.java:17: error: unnamed classes are a preview feature and are disabled by default.
int main() {
^
  (use --enable-preview to enable unnamed classes)
Main.java:21: error: ';' expected
    ll k,x;
      ^
Main.java:21: error: ';' expected
    ll k,x;
        ^
26 errors
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:25: error: expected ';' before ')' token
    8 |         for(i=0;i>=n,i++){
      |                         ^
      |                         ;
a.cc:9:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |                 if (s[i]=="A") c=1;
a.cc:10:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |                 if (s[i]=="B" && c==1) c=2;
a.cc:11:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |                 if (s[i]=="C" && c==2) {
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;i++) {
    if (i<3) {
      continue;
    }
    else if (S.at(i-2)== A &&S.at(i-1)== B &&S.at(i)== C) {
      count++;
    }
    else {
    }
  }
  cout << count <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:26: error: 'A' was not declared in this scope
   15 |     else if (S.at(i-2)== A &&S.at(i-1)== B &&S.at(i)== C) {
      |                          ^
a.cc:15:42: error: 'B' was not declared in this scope
   15 |     else if (S.at(i-2)== A &&S.at(i-1)== B &&S.at(i)== C) {
      |                                          ^
a.cc:15:56: error: 'C' was not declared in this scope
   15 |     else 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(void)
{
  int n;
  cin>>n;
  string s;
  cin>>s;
  int cnt=0;
  for(int i=0;i<s.length();i++)
  {
    if(s[i]=='A'&& s[i+1]='B' && s[i+2]='C')
    {
      cnt++;
    }
  }
  cout<<cnt<<endl;
}
#include <bits/stdc++.h>
using namespace std;
int main(void)
{
  int n;
  cin>>n;
  string s;
  cin>>s;
  int cnt=0;
  for(int i=0;i<s.length();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:12:31: error: lvalue required as left operand of assignment
   12 |     if(s[i]=='A'&& s[i+1]='B' && s[i+2]='C')
a.cc: At global scope:
a.cc:21:5: error: redefinition of 'int main()'
   21 | int main(void)
      |     ^~~~
a.cc:3:5: note: 'int main()' previously defined here
    3 | int main(void)
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void)
{
  int n;
  cin>>n;
  string s;
  cin>>s;
  int cnt=0;
  for(int i=0;i<s.length();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:12:31: error: lvalue required as left operand of assignment
   12 |     if(s[i]=='A'&& s[i+1]='B' && s[i+2]='C')
Language: Java

import java.util.Scanner;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Integer N;
      	String S;
        N = sc.nextInt();
        S = sc.nextLine();
           System.out.println(S.count("ABC");
    }
}

Compiler output:
Main.java:10: error: ')' or ',' expected
           System.out.println(S.count("ABC");
                                            ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int K ;
  string S ;
  cin >> K >> S ;
  int res = 0 ;
  for(int i = 0; i < (K-1); i++){
   if (S.at(i)=="A"&&S.at(i+1)=="B"&&S.at(i+2)=="C"){
   res++;
   }
  }
  cout << res << 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.at(i)=="A"&&S.at(i+1)=="B"&&S.at(i+2)=="C"){
      |        ~~~~~~~^~~~~
a.cc:10:31: 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:47: 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;
  string s;
  cin >> n;
  cin.ignore();
  cin >> s;
  cin.ignore();

  int cnt = 0;

  for (int i = 0; i < n - 2; i++){
    if(s[i] == 'A'){
      if(s.substr(i, 3) == "ABC"){
        ++cnt;
      }
    }
  }

  cout << cnt << endl;
  return 0;
}
#include <bits/stdc++.h>

using namespace std;



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

  int cnt = 0;

  for (int i = 0; i < n - 2; i++){
    if(s[i] == 'A'){
      if(s.substr(i, 3) == "ABC"){
        ++cnt;
      }
    }
  }

  cout << cnt << endl;
  return 0;
}


Compiler output:
a.cc:34:5: error: redefinition of 'int main()'
   34 | int main(){
      |     ^~~~
a.cc:7:5: note: 'int main()' previously defined here
    7 | int main(){
      |     ^~~~
Language: C

#include <stdio.h>

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


Compiler output:
main.c: In function 'main':
main.c:5:8: error: two or more data types in declaration specifiers
    5 |   char int[51];
      |        ^~~
main.c:5:11: error: expected identifier or '(' before '[' token
    5 |   char int[51];
      |           ^
main.c:7:15: error: 's' undeclared (first use in this function)
    7 |   scanf("%s", s);
      |               ^
main.c:7:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

// サンプルコード
// char配列srcに含まれる'a'を数える
int main()
{
    cin<<src;
    vector<char> v(src, src + sizeof(src));
    cout << count(v.begin(), v.end(), 'a');

    getchar();
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: 'src' was not declared in this scope
   11 |     cin<<src;
      |          ^~~
Language: C++

#define r(i, n) for (int i=2;i<n;i++)
#define ll long long
#define llc(n) ll n; cin >> n;
using namespace std;
int main() {
  int n,x=0;
  string s;
  cin >> n >> s;
  r(i, n) {
    if(s.at(i-2)=='A'&&s.at(i-1)=='B'&&s.at(i)=='C') x++;
  }
  cout << x << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'string' was not declared in this scope
    7 |   string s;
      |   ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | #define r(i, n) for (int i=2;i<n;i++)
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   cin >> n >> s;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #define r(i, n) for (int i=2;i<n;i++)
a.cc:8:15: error: 's' was not declared in this scope
    8 |   cin >> n >> s;
      |               ^
a.cc:12:3: error: 'cout' was not declared in this scope
   12 |   cout << x << endl;
      |   ^~~~
a.cc:12:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:12:16: error: 'endl' was not declared in this scope
   12 |   cout << x << endl;
      |                ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #define r(i, n) for (int i=2;i<n;i++)
Language: C++

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


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

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

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

int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	cout.tie(0);
	int n;
	cin>>n;
	char arr[n];
	int i;
	for( i=0;i<n;i++)
	cin>>arr[i];
	int cnt=0;
	for(i=2;i<n;i++){
		if (arr[i]=='C'&& arr[i-1]='B'&& arr[i-2]=='A'){
			cnt++;
		}
	}
	cout<<cnt<<endl;
	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:32: error: lvalue required as left operand of assignment
   16 |                 if (arr[i]=='C'&& arr[i-1]='B'&& arr[i-2]=='A'){
      |                     ~~~~~~~~~~~^~~~~~~~~~~
Language: Java


import java.util.Scanner;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        // Integer N;
      	String S;
        // N = sc.nextInt();
        S = sc.nextLine();
           System.out.println(S.count("ABC");
    }
}

Compiler output:
Main.java:11: error: ')' or ',' expected
           System.out.println(S.count("ABC");
                                            ^
1 error
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main()
{
  int n,i,c;
  cin>>n;
  string s;
  cin>>s;
  c=0;
  for(i=0;i<n;i++)
  {
    if(s[i]=="65")
    {
      if(s[i+1]=="66"&&s[i+2]=="67")
        c++;
    }}
  cout<<c;
  return 0;
}

  


Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |     if(s[i]=="65")
a.cc:15:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |       if(s[i+1]=="66"&&s[i+2]=="67")
a.cc:15:30: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |       if(s[i+1]=="66"&&s[i+2]=="67")
Language: C++

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


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

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

Compiler output:
main.c: In function 'main':
main.c:5:3: error: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    5 |   scnaf("%s",&n);
      |   ^~~~~
      |   scanf
Language: Java

import java.util.Scanner;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        // Integer N;
      	String S;
        N = sc.nextInt();
        S = sc.nextLine();
           System.out.println(S.count("ABC");
    }
}

Compiler output:
Main.java:10: error: ')' or ',' expected
           System.out.println(S.count("ABC");
                                            ^
1 error
Language: C++

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

  

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

N = int(input())
S = str(input())
print(S.count("ABC"))
  
import java.util.Scanner;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        // Integer N;
      	String S;
        N = sc.nextInt();
        S = sc.nextLine();
           System.out.println(S.count("ABC");
    }
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
N = int(input())
^
Main.java:14: error: ')' or ',' expected
           System.out.println(S.count("ABC");
                                            ^
2 errors
Language: Java

import java.util.Scanner;

public class B {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String S = sc.next();
		int ind = S.indexOf("ABC");
		int cnt = 0;
	    while(ind >= 0){
			++cnt;
			ind = S.indexOf("ABC", ind + 1);			
		}
	    System.out.println(cnt);
	}
}


Compiler output:
Main.java:3: error: class B is public, should be declared in a file named B.java
public class B {
       ^
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; i++){
    string a=s.at(i)+s.at(i+1)+s.at(i+2);
    if(a=="abc")ans++;
  }
  cout<<ans<<endl;
  return 0;
}


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

int count(string a, string b, int m, int n) 
{ 
    // If both first and second string is empty, 
    // or if second string is empty, return 1 
    if ((m == 0 && n == 0) || n == 0) 
        return 1; 
  
    // If only first string is empty and second 
    // string is not empty, return 0 
    if (m == 0) 
        return 0; 
  
    // If last characters are same 
    // Recur for remaining strings by 
    // 1. considering last characters of both strings 
    // 2. ignoring last character of first string 
    if (a[m - 1] == b[n - 1]) 
        return count(a, b, m - 1, n - 1) + 
               count(a, b, m - 1, n); 
    else
        // If last characters are different, ignore  
        // last char of first string and recur for  
        // remaining string 
        return count(a, b, m - 1, n); 
} 
  
// Driver code 
int main() 
{ 
    int n;string a;
  cin>>n>>a;
    string b = "ABC"; 
  
    cout << count(a, b, a.size(), b.size());
  
    return 0; 
} 

Compiler output:
a.cc:1:11: error: 'string' was not declared in this scope
    1 | int count(string a, string b, int m, int n)
      |           ^~~~~~
a.cc:1:21: error: 'string' was not declared in this scope
    1 | int count(string a, string b, int m, int n)
      |                     ^~~~~~
a.cc:1:31: error: expected primary-expression before 'int'
    1 | int count(string a, string b, int m, int n)
      |                               ^~~
a.cc:1:38: error: expected primary-expression before 'int'
    1 | int count(string a, string b, int m, int n)
      |                                      ^~~
a.cc:1:43: error: expression list treated as compound expression in initializer [-fpermissive]
    1 | int count(string a, string b, int m, int n)
      |                                           ^
a.cc: In function 'int main()':
a.cc:30:11: error: 'string' was not declared in this scope
   30 |     int n;string a;
      |           ^~~~~~
a.cc:31:3: error: 'cin' was not declared in this scope
   31 |   cin>>n>>a;
      |   ^~~
a.cc:31:11: error: 'a' was not declared in this scope
   31 |   cin>>n>>a;
      |           ^
a.cc:32:11: error: expected ';' before 'b'
   32 |     string b = "ABC";
      |           ^~
      |           ;
a.cc:34:5: error: 'cout' was not declared in this scope; did you mean 'count'?
   34 |     cout << count(a, b, a.size(), b.size());
      |     ^~~~
      |     count
a.cc:34:22: error: 'b' was not declared in this scope
   34 |     cout << count(a, b, a.size(), b.size());
      |                      ^
a.cc:34:43: error: 'count' cannot be used as a function
   34 |     cout << count(a, b, a.size(), b.size());
      |                                           ^
Language: Java

import java.util.*;

public class A {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.nextLine();
        String s = sc.nextLine();
        char[] p = {'a', 'b', 'c'};
        int idx = 0;
        int count = 0;

        for (int i = 0; i < n; i++) {
            if (s.charAt(i) != p[idx]) {
                idx = s.charAt(i) == p[0] ? 1 : 0;
            }
            else idx++;
            if (idx == 3) {
                idx = 0;
                count++;
            }
        }
        System.out.println(count);
    }
}

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |         if(s[i]="A"&&s[i+1]=="B"&&s[i+2]=="C"){
a.cc:10:41: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |         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,ans=0;
	string s;
	cin >> n >> s;
	for(int i = 0;i<n;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:13:18: error: expected '}' at end of input
   13 |         return 0;
      |                  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main()
{
int n,ans=0;
  string s;
  REPt(i,n-2){
  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:14:8: error: 'i' was not declared in this scope
   14 |   REPt(i,n-2){
      |        ^
a.cc:14:3: error: 'REPt' was not declared in this scope; did you mean 'REP'?
   14 |   REPt(i,n-2){
      |   ^~~~
      |   REP
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'in' was not declared in this scope; did you mean 'n'?
    6 |   in>>n>>data;
      |   ^~
      |   n
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;i++) {
    if (i<3) {
      continue;
    }
    else if (S.at(i-2)== "A" &&S.at(i-1)== "B" &&S.at(i)== "C") {
      count++;
    }
    else {
    }
  }
  cout << count <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |     else if (S.at(i-2)== "A" &&S.at(i-1)== "B" &&S.at(i)== "C") {
      |              ~~~~~~~~~^~~~~~
a.cc:15:41: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |     else if (S.at(i-2)== "A" &&S.at(i-1)== "B" &&S.at(i)== "C") {
      |                                ~~~~~~~~~^~~~~~
a.cc:15:57: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |     else 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 pos=s.find("ABC",0);
	int sum=0;
	
	while(pos!=string::npos)
	{
		sum++;
		pos=sum.find("ABC",pos+3);
	}
	
	cout<<sum<< endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:25: error: request for member 'find' in 'sum', which is of non-class type 'int'
   16 |                 pos=sum.find("ABC",pos+3);
      |                         ^~~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:28:12: error: expected ';' before '}' token
   28 |       b = 0
      |            ^
      |            ;
   29 |     }
      |     ~
Language: C++

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

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

#include<bits/stdc++.h> 
using namespace std; 
   
int countFreq(string &pat, string &txt) 
{ 
    int M = pat.length(); 
    int N = txt.length(); 
    int res = 0; 
    
    /* A loop to slide pat[] one by one */
    for (int i = 0; i <= N - M; i++) 
    {  
        /* For current index i, check for  
           pattern match */
        int j; 
        for (j = 0; j < M; j++) 
            if (txt[i+j] != pat[j]) 
                break; 
   
        // if pat[0...M-1] = txt[i, i+1, ...i+M-1] 
        if (j == M)   
        { 
           res++; 
           j = 0; 
        } 
    } 
    return res; 
} 
    
/* Driver program to test above function */
int main() 
{ 
  ll n;
  cin>>n;
   string txt;
  cin>>txt;
   string pat = "ABC"; 
   cout << countFreq(pat, txt); 
   return 0; 
} 


Compiler output:
a.cc: In function 'int main()':
a.cc:33:3: error: 'll' was not declared in this scope
   33 |   ll n;
      |   ^~
a.cc:34:8: error: 'n' was not declared in this scope; did you mean 'yn'?
   34 |   cin>>n;
      |        ^
      |        yn
Language: C++

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

int main()
{
	int n;
	string s;
	cin>>n>>s;
	
	int pos=s.find("ABC",0);
	int s=0;
	
	while(pos!=string::npos)
	{
		s++;
		pos=s.find("ABC",pos+3);
	}
	
	cout<<s<< endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: conflicting declaration 'int s'
   11 |         int s=0;
      |             ^
a.cc:7:16: note: previous declaration as 'std::string s'
    7 |         string s;
      |                ^
a.cc:15:18: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   15 |                 s++;
      |                 ~^~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |         if(str[i]=="A" && str[i+1]=="B" $$ str[i+2]=="C") ans++;
a.cc:12:35: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |         if(str[i]=="A" && str[i+1]=="B" $$ str[i+2]=="C") ans++;
a.cc:12:40: error: expected ')' before '$$'
   12 |         if(str[i]=="A" && str[i+1]=="B" $$ str[i+2]=="C") ans++;
      |           ~                            ^~~
      |                                        )
Language: C++

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

int compare_int(const void*a,const void*b){
    return *(int*)a - *(int*)b;
}
int main() {
    int n; cin >> n;
    string a; cin >> a;

    int ans = 0;
    for (int i = 1; i <= n - 2; i++) {
        if (a.substr(i, 3) == "ABC") ans += 1;
    }
    cout << ans << endl;

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

#include<bits/stdc++.h>
using namespace std;
char s[50];
int n,cnt;
int main()
{
	scanf("%d\n",&n);
	n-=2;
	gets(s);
	for(int i=0;i<n;i++)
		if(s[i]=='A'&&s[i+1]=='B'&&s[i+2]=='C')
			cnt++,i+=2;
	printf("%d\n",cnt);
	return 0;
}

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

#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;i++) {
    if (i<3) {
      continue;
    }
    else if (S.at(i-2)=="A"&&S.at(i-1)=="B"&&S.at(i)=="C") {
      count++;
    }
    else {
    }
  }
  cout << count <<endl;
}


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

n = int(input())
s = input()
print(s.count('ABC'))

Compiler output:
a.cc:3:15: warning: multi-character character constant [-Wmultichar]
    3 | print(s.count('ABC'))
      |               ^~~~~
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: C++

N = int(input())
S = input()
temp = 0
count = 0
while S < N:
    if S[temp] == A:
        if S[temp:temp+3] == "ABC":
            count += 1
            temp += 3
    else:
        temp += 1
print(count)

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N = int(input())
      | ^
Language: C++

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

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

#include <stdio.h>
int main(void){
    // Your code here!
    int n;
    char s[55];
    int count=0;
    
    scanf("%d", &n);
    scanf("%s", s);
    
    for(int i=0; i<n-2; i++){
        if(s[i]=='a'){
            if(s[i+1]==b && s[i+2]==c) count++;
        }
    }
    
    printf("%d", count);
}


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

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define vi vector<int>
#define pii pair<int,int>
#define mii map<int,int>
#define mod 1000000007
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n;
  string s;
  cin>>n;
  cin>>s;
  int count=0;
  for(i=0;i<n-2;i++)
  {
    if(s[i]=='A'&&s[i+1]=='B'&&s[i+2]=='C')
      count++;
  }
  cout<<count<<endl;
    return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define INF 1000000010
#define EPS 1e-9
#define fst first
#define scd second

#define debug(x) cout<<x<<endl;
#define repi(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) repi(i,0,n)
#define lp(i,n) repi(i,0,n)
#define repn(i,n) for(int i=n;i>=0;i--)
#define int long long
#define endl "\n"


signed main(){
  cin.tie(0);	
  ios::sync_with_stdio(false);
  string s;
  int n;
  cin>>n>>s;
  int cnt=0;
  rep(i,n-2){
    
      if(s[j]=='A' && s[j+1]=='B' && s[j+2]=='C') cnt++;
    
  }
  cout<<cnt<<endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:12: error: 'j' was not declared in this scope
   27 |       if(s[j]=='A' && s[j+1]=='B' && s[j+2]=='C') cnt++;
      |            ^
Language: C++

input()
s = input()
ans = 0
while 1:
    pos = s.find('ABC')
    if pos == -1:
        break
    ans += 1
    s = s[pos + 3:]
print(ans)


Compiler output:
a.cc:5:18: warning: multi-character character constant [-Wmultichar]
    5 |     pos = s.find('ABC')
      |                  ^~~~~
a.cc:2:1: error: expected constructor, destructor, or type conversion before 's'
    2 | s = input()
      | ^
Language: C++

#include<bits/stdc++.h>
#define ios ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
using namespace std;
int a[100],b[100],n,f[100],c[100];
int lowbit(int x){
	return x&(-x);
}
void add(int pos){
	while(pos<=n){
		tr[pos]+=1;
		pos+=lowbit(pos);
	}
}
int pre(int x){
	int sum=0;
	while(x){
		sum+=c[x];
		x-=lowbit(x);
	}
	return sum;
}
void init(){
	f[0]=1;
	for(int i=1;i<=30;++i){
		f[i]=f[i-1]*i;
	}
}
int cantor_exp(int *p){
	int sum=0;
	for(int i=n;i>=1;--i){
		int a=pre(p[i]-1);
		sum+=a*f[n-i];
		add(p[i]);
	}
	return sum;
}
int main()
{
	ios;
	cin>>n;
	init();
	for(int i=1;i<=n;++i) cin>>a[i];
	for(int i=1;i<=n;++i) cin>>b[i];
	int s1,s2;
	s1=cantor_exp(a,n);
	memset(c,0,sizeof c);
	s2=cantor_exp(b,n);
	cout<<abs(s1-s2)<<'\n';
}

Compiler output:
a.cc: In function 'void add(int)':
a.cc:10:17: error: 'tr' was not declared in this scope; did you mean 'tm'?
   10 |                 tr[pos]+=1;
      |                 ^~
      |                 tm
a.cc: In function 'int main()':
a.cc:45:22: error: too many arguments to function 'int cantor_exp(int*)'
   45 |         s1=cantor_exp(a,n);
      |            ~~~~~~~~~~^~~~~
a.cc:28:5: note: declared here
   28 | int cantor_exp(int *p){
      |     ^~~~~~~~~~
a.cc:47:22: error: too many arguments to function 'int cantor_exp(int*)'
   47 |         s2=cantor_exp(b,n);
      |            ~~~~~~~~~~^~~~~
a.cc:28:5: note: declared here
   28 | int cantor_exp(int *p){
      |     ^~~~~~~~~~
Language: C++

#i#include<iostream>
#include<algorithm> 
#include<cstring>
#define ios ios::sync_with_stdio(false)
#define mem(arr) memset(arr,0,sizeof(arr))
using namespace std;
typedef long long ll;
const ll maxn = 1e6 + 10;

int n,a[10],b[10],ans = 0; 

void solve(int a[],int b[])
{
	do
	{
		int flag = 1;
		for(int i = 0;i < n; i++)
		{
			if(a[i] != b[i])
			{
				flag = 0;
				ans++;
				break;
			}
		}
		if(flag) 
			break;
	}while(next_permutation(a,a+n));
}

int main()
{
	cin>>n;
	for(int i = 0;i < n; i++) 
		cin>>a[i];
	for(int i = 0;i < n; i++) 
		cin>>b[i];
	for(int i = 0;i < n; i++)
	{
		if(a[i] < b[i])
		{
			solve(a,b);
			break;
		}
		else if(a[i] > b[i])
		{
			solve(b,a);
			break;
		}
	}
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #i; did you mean #if?
    1 | #i#include<iostream>
      |  ^
      |  if
a.cc: In function 'int main()':
a.cc:33:9: error: 'cin' was not declared in this scope
   33 |         cin>>n;
      |         ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include<cstring>
  +++ |+#include <iostream>
    4 | #define ios ios::sync_with_stdio(false)
a.cc:51:9: error: 'cout' was not declared in this scope
   51 |         cout<<ans<<endl;
      |         ^~~~
a.cc:51:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:51:20: error: 'endl' was not declared in this scope
   51 |         cout<<ans<<endl;
      |                    ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include<cstring>
  +++ |+#include <ostream>
    4 | #define ios ios::sync_with_stdio(false)