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

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

Compiler output:
a.cc:3:7: error: expected nested-name-specifier before 'namepsace'
    3 | using namepsace std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'string' was not declared in this scope
    7 |   string s;
      |   ^~~~~~
a.cc:7:3: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 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/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |   cin>>s;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:8:8: error: 's' was not declared in this scope
    8 |   cin>>s;
      |        ^
a.cc:16:8: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |        cout<<count;
      |        ^~~~
      |        std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

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

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:3: error: 'string' was not declared in this scope
    6 |   string s;
      |   ^~~~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 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/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin>>s;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:8: error: 's' was not declared in this scope
    7 |   cin>>s;
      |        ^
a.cc:15:8: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |        cout<<count;
      |        ^~~~
      |        std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

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

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namepsace'
    2 | using namepsace std;
      |       ^~~~~~~~~
a.cc:3:1: error: expected unqualified-id before '{' token
    3 | {
      | ^
Language: C++

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

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namepsace'
    2 | using namepsace std;
      |       ^~~~~~~~~
a.cc:3:1: error: expected unqualified-id before '{' token
    3 | {
      | ^
Language: C++

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
 
using namespace std;
using namespace __gnu_pbds;
 
//find_by_order gives kth-largest element
//order_of_key gives the number of items in the set that are strictly smaller!!
 
// OT.find_by_order(k-1)
// 
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
 
#define db(x) cerr << #x << "=" << x << endl
#define db2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define db3(x, y, z) cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << endl
#define db4(x, y, z, w) cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << "," << #w << "=" << w << endl
#define ll long long
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define mp make_pair
#define X first
#define Y second
#define sz(x) (int)((x).size())
#define pii pair<int,int>
#define MOD (ll)(1e9 + 7)
#define rep(i, n)    for(int i = 0; i < (n); ++i)
#define repA(i, a, n)  for(int i = a; i <= (n); ++i)
#define repD(i, a, n)  for(int i = a; i >= (n); --i)
#define trav(a, x) for(auto& a : x)
typedef vector<int> vi;
#define inf (ll)(1e18)
#define double long double
#define int long long
 
//////////////////////
const int N = 100005;


int32_t main() {
 
    ios::sync_with_stdio(false);
    cin.tie(0); 
    cout.tie(0);
	
	int tt = 1;
	// cin/ >> tt;
	while(tt--) {
		int n;
		string st;
		cin >> n >> st;
		int cnt = 0;
		rep(i,n) if(st[i]=='A' and i+1<n and st[i+1]=='B' and i+2<n and st[i+2]=='C') cnt++;
	}	cout << cnt << '\n';
}


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:56:25: error: 'cnt' was not declared in this scope; did you mean 'int'?
   56 |         }       cout << cnt << '\n';
      |                         ^~~
      |                         int
Language: C++

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

int main(){
  int n; string s;
  cin >> n >> s;
  int res = 0;
  for(int i=0; i<n-3; ++i){
    if(s[i]=='a'&&s[i+1]=='b'&&s[i+2]=='c'){
      ++res;
    }
  }
  puts(res);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:8: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   13 |   puts(res);
      |        ^~~
      |        |
      |        int
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 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/stdio.h:714:30: note:   initializing argument 1 of 'int puts(const char*)'
  714 | extern int puts (const char *__s);
      |                  ~~~~~~~~~~~~^~~
Language: C++

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

int main(){
  int n; string s;
  cin >> n >> s;
  ll res = 0;
  for(int i=0; i<n-3; ++i){
    if(s[i]=='a'&&s[i+1]=='b'&&s[i+2]=='c'){
      ++res;
    }
  }
  puts(res);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'll' was not declared in this scope
    7 |   ll res = 0;
      |   ^~
a.cc:10:9: error: 'res' was not declared in this scope
   10 |       ++res;
      |         ^~~
a.cc:13:8: error: 'res' was not declared in this scope
   13 |   puts(res);
      |        ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  	string s;int n;
  cin>>n>>s;
  int count=0;
  for(i=0;i<=n-3;i++)
  {
    if(s.substr(i,3)=="ABC")
     count++;
  }
	return 0;
}


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

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <climits>
#include <string>
#include <bitset>
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vpii;
typedef vector<pair<string,int>> vpsi;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define fin(ans) cout<<(ans)<<endl
#define STI(s) atoi(s.c_str())
#define mp(p,q) make_pair(p,q)
#define pb(n) push_back(n)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define Sort(a) sort(a.begin(),a.end())
#define Rort(a) sort(a.rbegin(),a.rend())
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
const int P = 1000000007;
const int INF = INT_MAX;
const ll LLINF = 1LL<<60;

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

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

//////////////////////////////////////////////////////
return 0;}


Compiler output:
a.cc: In function 'int main()':
a.cc:54:13: error: expected ';' before '}' token
   54 |         i+=2
      |             ^
      |             ;
   55 |     }
      |     ~
Language: C++

#include <iostream>
#include <cstdio.h>
using namespace std;
int main (){
     string cadena;int cant=0;
     gets (cadena);
     for (int i=0;i<cadena.size();i++){
           if(cadena[i]=='A'){
                  if (cadena[i+1]=='B' && cadena[i+2]=='C' && i+1<cadena.size () && i+2<cadena.size()){
                         cant++;
                 }
           }
    }
    cout<<cant;
    return 0;
}

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

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

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

#include <bits/stdc++.h>
using namespace std;
int main (){
     string cadena;int cant=0;
     cin.getline (cadena,100,'\0');
     for (int i=0;i<cadena.size();i++){
           If (cadena[i]=='A'){
                  If (cadena[i+1]=='B' && cadena[i+2]=='C' && i+1 <cadena.size () && i+2 <cadena.size ()){
                         cant++;
                 }
           }
    }
    cout<<cant;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:18: error: no matching function for call to 'std::basic_istream<char>::getline(std::string&, int, char)'
    5 |      cin.getline (cadena,100,'\0');
      |      ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
                 from a.cc:1:
/usr/include/c++/14/istream:740:5: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::getline(char_type*, std::streamsize, char_type) [with _CharT = char; _Traits = std::char_traits<char>; char_type = char; std::streamsize = long int]'
  740 |     basic_istream<char>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:509:26: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::basic_istream<char>::char_type*' {aka 'char*'}
  509 |       getline(char_type* __s, streamsize __n, char_type __delim);
      |               ~~~~~~~~~~~^~~
/usr/include/c++/14/istream:520:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::getline(char_type*, std::streamsize) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; char_type = char; std::streamsize = long int]'
  520 |       getline(char_type* __s, streamsize __n)
      |       ^~~~~~~
/usr/include/c++/14/istream:520:7: note:   candidate expects 2 arguments, 3 provided
a.cc:7:12: error: 'If' was not declared in this scope
    7 |            If (cadena[i]=='A'){
      |            ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MOD 1000000007

int main(){
  ll n;
  string s;
  cin >> n >> s;
  
  ll ans = 0;
  char exp = 'A';
  for(ll i=0; i<n; i++){
    if(exp == 'C' && s[i] == exp){
      ans++;
      exp = 'A';
    }
  	if(s[i] == exp){
      exp++;
    }else if(s[i] == 'A'){
      exp = 'B'
    }else{
      exp = 'A';
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:16: error: expected ';' before '}' token
   21 |       exp = 'B'
      |                ^
      |                ;
   22 |     }else{
      |     ~
Language: C++

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

int main(){
  char str[60];
  int N;
  char *p;
  cin>>N;
  fgets(str,sizeof(str),stdin);
  
  int i=0;
  p=strstr(srr,"ABC");
  while(p!=NULL){
    i++;
    p=p+3;
    p=strstr(p,"ABC");
  }
  cou<<i<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:12: error: 'srr' was not declared in this scope; did you mean 'str'?
   12 |   p=strstr(srr,"ABC");
      |            ^~~
      |            str
a.cc:18:3: error: 'cou' was not declared in this scope; did you mean 'cos'?
   18 |   cou<<i<<endl;
      |   ^~~
      |   cos
Language: C++

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

int main(){
  str[60];
  int N;
  char *p;
  cin>>N;
  fgets(str,sizeof(str),stdin);
  
  int i=0;
  p=strtok(str,"ABC");
  while(p!=NULL){
    i++;
    p=strtok(NULL,"ABC");
  }
  cout<<i<<endl;
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'str' was not declared in this scope; did you mean 'std'?
    5 |   str[60];
      |   ^~~
      |   std
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:26: error: lvalue required as left operand of assignment
   15 |   if(s[i]='A'&&s[i+1]='B'&&s[i+2]='C')
      |                       ~~~^~~~~~~~
Language: C++

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

int main(){
  char str[60];
  char *p;
  fgets(str,sizeof(str),stdin);
  fgets(str,sizeof(str),stdin);
  int i=0;
  p=strstr(str,"ABC");
  while(p!=NULL){
    i++;
    str=p+3;
    p=strstr(str,"ABC");
  }
  printf("%d\n",i);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:8: error: incompatible types in assignment of 'char*' to 'char [60]'
   14 |     str=p+3;
      |     ~~~^~~~
Language: C++

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

int main(){
  char str[60];
  char *p;
  fgets(str,sizeof(str),stdin);
  fgets(str,sizeof(str),stdin);
  int i=0;
  p=strstr(str,"ABC");
  while(p!=NULL){
    i++;
    str=*(p+3);
    p=strstr(str,"ABC");
  }
  printf("%d\n",i);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:8: error: incompatible types in assignment of 'char' to 'char [60]'
   14 |     str=*(p+3);
      |     ~~~^~~~~~~
Language: Java

mport java.util.Scanner;

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

        String s =sc.next();
        if(s.length()>N){
            return;
        }
        s.toUpperCase();
        int index = s.indexOf("ABC",0);
        if(index==-1){
            System.out.println(0);
            return;
        }
        while (index!=-1){
            count++;
            index=s.indexOf("ABC",index+2);
        }
        System.out.println(count);
    }
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.Scanner;
^
1 error
Language: Java

import java.util.Scanner;

public class C150 {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String s = sc.next();
		char[] chrs = s.toCharArray();
		System.out.println(chrs[2]);
		int count=0;
		for(int i=2; i<N; i++)
		{
			if(chrs[i]=='C' && chrs[i-1]=='B'&& chrs[i-2]=='A' )
			{
				//System.out.println("hh");
				count++;
			}
			
		}
		System.out.println(count);
	}
}


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

#include<stadio.h>
int main(){
int N,i,c,j;
	char S[100],T[3];
 	scanf("%d",&N);
  	scanf("%s%s",&S,&T);
  	for(i=3;i<N;i++){
    	for(j=0;j<3;j++){
  			if(S[i]==T[j]&&S[i+1]==T[j+1]&&S[i+2]==T[j+2]){
  				c++;
  			}
  			else 
			break;
		}
    }
printf("%d",c);
}

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

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

using namespace std;

int main(void){
  int n; cin >> n;
  char s[n];
  rep(i,n) cin >> s[i];
  int ans = 0;
  for(int i = 1; i < n-1; i++{
    if(s[i-1] == 'A' && s[i] == 'B' && s[i+1] == 'C'){
      ans++;
    }
  }
  printf("%d\n",ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:30: error: expected ')' before '{' token
   11 |   for(int i = 1; i < n-1; i++{
      |      ~                       ^
      |                              )
Language: C++

def main():
    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)
    

if __name__ == '__main__':
    main()

Compiler output:
a.cc:11:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   11 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:1:1: error: 'def' does not name a type
    1 | def main():
      | ^~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:19:11: error: expected primary-expression at end of input
   19 |     return
      |           ^
a.cc:19:11: error: expected ';' at end of input
   19 |     return
      |           ^
      |           ;
a.cc:19:11: error: expected '}' at end of input
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0;i < (int)(n);i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n);i++)
#define ALL(vec)  (vec).begin(),(vec).end()
#define lli long long int
#define pi 3.1415926535897932384626433832795
#define MAX_INF 9223372036854775807
#define MIN_INF 9223372036854775807+1

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: expected initializer before '==' token
   15 |   int x ==0;
      |         ^~
a.cc:20:5: error: 'x' was not declared in this scope
   20 |     x++;
      |     ^
a.cc:26:11: error: 'x' was not declared in this scope
   26 |   cout << x << endl;
      |           ^
Language: C++

input()
print(input().count('ABC'))


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

N = int(input())
S = input()
ans = 0

for i in range(N - 3):
    if S[i] == 'A':
        i += 1
        if S[i] == 'B':
            i += 1
            if S[i] == 'C':
                i += 1
                ans += 1

print(ans)


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

#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cfloat>
#include <complex>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++)
#define ll long long
using namespace std;



int main(){

    int n,p;
    string s;

    for(int i = 3;i < n;i ++){

        if(s[i] == "a" && s[i + 1] == "b" && s[i + 2] == "c"){

            p++;


        }

        
    }

    cout << p <<endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   39 |         if(s[i] == "a" && s[i + 1] == "b" && s[i + 2] == "c"){
a.cc:39:36: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   39 |         if(s[i] == "a" && s[i + 1] == "b" && s[i + 2] == "c"){
a.cc:39:55: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   39 |         if(s[i] == "a" && s[i + 1] == "b" && s[i + 2] == "c"){
Language: C++

#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cfloat>
#include <complex>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++)
#define ll long long
using namespace std;



int main(){

    int n,p;
    string s;

    for(int i = 3;i < n;i ++){

        if(S[i] == "a" && s[i + 1] == "b" && s[i + 2] == "c"){

            p++;


        }

        
    }

    cout << p <<endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:12: error: 'S' was not declared in this scope
   39 |         if(S[i] == "a" && s[i + 1] == "b" && s[i + 2] == "c"){
      |            ^
a.cc:39:36: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   39 |         if(S[i] == "a" && s[i + 1] == "b" && s[i + 2] == "c"){
a.cc:39:55: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   39 |         if(S[i] == "a" && s[i + 1] == "b" && s[i + 2] == "c"){
Language: C++

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


Compiler output:
a.cc:19:3: error: expected declaration before '}' token
   19 |   }
      |   ^
a.cc:20:3: error: 'cout' does not name a type
   20 |   cout << count << endl;
      |   ^~~~
a.cc:21:3: error: expected unqualified-id before 'return'
   21 |   return 0;
      |   ^~~~~~
a.cc:22:1: error: expected declaration before '}' token
   22 | }
      | ^
Language: C++

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: 'N' was not declared in this scope
    8 |     for(int i=1;i<N-1;i++){
      |                   ^
a.cc:9:31: error: unable to find character literal operator 'operator""$$s' with 'char' argument
    9 |         if(s[i-1]=='A'&&s[i]=='B'$$s[i+1]=='C')
      |                               ^~~~~~
a.cc:10:14: error: expected ';' before '}' token
   10 |         ans++
      |              ^
      |              ;
   11 |     }
      |     ~
Language: C++

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

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 <bits/stdc++.h>
using namespace std;
int main (){
  int n;
  string s;
  cin>>n>>s;
  int c=0,flag=0;
  for(i=0;i<n;i++){
    if(flag==0&&s[i]=='A')
      flag++;
    else if (flag==1&&s[i]=='B')
      flag++;
    else if(flag==2&&s[i]=='C')
      flag++;
    else if(flag==3){
      c++;
      flag==0;
    }
    else
      flag==0;
  }
  cout<<c;
  return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
int main (){
  int n;
  string s;
  cin>>n>>s;
  int c=0,flag==0;
  for(i=0;i<n;i++){
    if(flag==0&&s[i]=='A')
      flag++;
    else if (flag==1&&s[i]=='B')
      flag++;
    else if(flag==2&&s[i]=='C')
      flag++;
    else if(flag==3){
      c++;
      flag==0;
    }
    else
      flag==0;
  }
  cout<<c;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: expected initializer before '==' token
    7 |   int c=0,flag==0;
      |               ^~
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   for(i=0;i<n;i++){
      |       ^
a.cc:9:8: error: 'flag' was not declared in this scope
    9 |     if(flag==0&&s[i]=='A')
      |        ^~~~
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int n;
  cin>>n;
  char s[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;
  
}

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

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

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

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

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:43: error: expected primary-expression before '=' token
   12 | if(s[i-2]=='A' && s[i-1] == 'B' && s[i] = = 'C')
      |                                           ^
Language: C++

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

#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3,Ofast,no-stack-protector,unroll-loops,fast-math")
#define IOS ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
int main(){
    int n;
    string s;
    cin>>n>>s;
    int ans=0;
    for(int i=0;i<n-2;i++){
	if(s[i]+s[i+1]+s[i+2]=="ABC"){
	    ans++;
	}
    }
    cout<<ans;
}


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

#include<iostream>
using namespace std;

int main()
{
  string str;
  
   int i = 0; 
    while (str[i] != '\0') 
    { 
        ++i; 
    } 
    int length = i;
	int ans = 0;
  for(i=0;i<length;i++)
  {
    if(str[i] == 'A' && ((i+2) < length))
    {
      if(str[i+1] == 'B')
      {
        if(str[i+2] == 'C')
        {
          ans += 1;
        }
    }
  }
    
    cout << ans << "\n";
}

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

#include <iostream>
using namespace std;

int main(){
  int n;
  int cnt=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")cnt++;
  }
  cout << cnt<<endl;
  return 0;
}


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

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

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

#define int long long

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

Compiler output:
a.cc: In function 'int main()':
a.cc:19:3: error: 'retunr' was not declared in this scope
   19 |   retunr 0;
      |   ^~~~~~
Language: C++

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

Compiler output:
a.cc:3:5: error: cannot declare '::main' to be a global variable
    3 | int main(
      |     ^~~~
a.cc:4:7: error: expected primary-expression before 'int'
    4 |   {   int i,c=0,n;
      |       ^~~
a.cc:4:7: error: expected '}' before 'int'
    4 |   {   int i,c=0,n;
      |   ~   ^~~
a.cc:4:4: error: expected ')' before 'int'
    4 |   {   int i,c=0,n;
      |    ^  ~~~
      |    )
a.cc:3:9: note: to match this '('
    3 | int main(
      |         ^
a.cc:4:13: error: 'c' was not declared in this scope
    4 |   {   int i,c=0,n;
      |             ^
a.cc:4:17: error: 'n' was not declared in this scope; did you mean 'yn'?
    4 |   {   int i,c=0,n;
      |                 ^
      |                 yn
a.cc:5:4: error: 'cin' does not name a type
    5 |    cin>>n;
      |    ^~~
a.cc:6:13: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |    char arr[n] ;
      |             ^
      |             yn
a.cc:7:4: error: expected unqualified-id before 'for'
    7 |    for(i=0;i<n;i++)
      |    ^~~
a.cc:7:12: error: 'i' does not name a type
    7 |    for(i=0;i<n;i++)
      |            ^
a.cc:7:16: error: 'i' does not name a type
    7 |    for(i=0;i<n;i++)
      |                ^
a.cc:9:4: error: expected unqualified-id before 'for'
    9 |    for(i=0;i<n;i++){
      |    ^~~
a.cc:9:12: error: 'i' does not name a type
    9 |    for(i=0;i<n;i++){
      |            ^
a.cc:9:16: error: 'i' does not name a type
    9 |    for(i=0;i<n;i++){
      |                ^
a.cc:16:4: error: 'cout' does not name a type
   16 |    cout<<c<<endl;
      |    ^~~~
a.cc:18:3: error: expected declaration before '}' token
   18 |   }
      |   ^
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; i++) {
    if(s[i] == "A" && s[i+1] == "B" && s[i+2] == "C") {
      ans++;
      i + 2;
    }
    cout << ans << endl;
  }
}

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

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

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

  int ans = 0,

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: expected unqualified-id before 'for'
   11 |   for (int i = 0; i < n; i++) {
      |   ^~~
a.cc:11:19: error: 'i' was not declared in this scope
   11 |   for (int i = 0; i < n; i++) {
      |                   ^
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; i++) {
    if(s.at(i) == "A" && s.at(i+1) == "B" && s.at(i+2) == "C") {
      ans++;
      i + 2;
    }
    cout << ans << endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: expected unqualified-id before 'for'
   11 |   for (int i = 0; i < n; i++) {
      |   ^~~
a.cc:11:19: error: 'i' was not declared in this scope
   11 |   for (int i = 0; i < n; i++) {
      |                   ^
Language: Java

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


Compiler output:
Main.java:7: error: cannot find symbol
    for(int i=3;i<=s.length;i++)
                    ^
  symbol:   variable length
  location: variable s of type String
1 error
Language: Java

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

Compiler output:
Main.java:7: error: cannot find symbol
    for(int i=2;i<n;i++)
                  ^
  symbol:   variable n
  location: class Main
1 error
Language: C

#include <stdio.h>

int main() {
  int n;
  char s[50];

  int cnt;

  int num = 0;

  scanf("%d", &n);
  scanf("%s", s);

  for(cnt = 0; cnt < n - 2; cnt++) {
    if(s[cnt] = 'a' && s[cnt + 1] = 'b' && s[cnt + 2] = 'c')
      num++;
  }

  printf("%d", num);
  
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:15:55: error: lvalue required as left operand of assignment
   15 |     if(s[cnt] = 'a' && s[cnt + 1] = 'b' && s[cnt + 2] = 'c')
      |                                                       ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define x first
#define y second
#define mp make_pair
#define pb push_back

typedef long long ll;

const ll MOD = 1e9+7;
const ll INF = 1e9+5;

int main() {
	int n;
	string s;
	cin >>n>>s;
	int cnt = 0;
	for (int i=0 ; i<n-2 ; i++) {
		if (s[i] == 'A' and a[i+1] == 'B' and s[i+2] == 'C') cnt++;
	}
	printf("%d\n", cnt);
	return 0;
}

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

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

public class Main {

	private static void solve() throws Exception{
		//Implement solution here.
		int n = ni();
		char[] s = next().toCharArray();
		int tmp = 0;
		int result = 0;
		for(int i = 0; i < n; i++) {
			char c = s[i];
			if(tmp == 0) {
				if(c == 'A') tmp++;
			}else if(tmp == 1) {
				if(c == 'B') {
					tmp++;
				} else {
					tmp = 0;
				}
			}else if(tmp == '2') {
				if(c == 'C') result++;
				tmp = 0;
			}else {
				throw new Exception();
			}
		}
		System.out.println(result);
	}

	//Switch input source (stdin/file)
	private static BufferedReader br;
	public static void main(String[] args){
		br = new BufferedReader(new InputStreamReader(System.in));
		String debugDataPath = System.getenv("DD_PATH");        
		if(debugDataPath != null){
			try{
				br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));
			}catch(Exception e){
				throw new RuntimeException(e);
			}
		}
		solve();
	}

	//Input read utility
	private static StringTokenizer tokenizer = null;
	public static String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}
	//Get next single int
	private static int ni() {
		return Integer.parseInt(next());
	}
	//Get next single long
	private static long nl() {
		return Long.parseLong(next());
	}
	//Get next single double
	private static double nd() {
		return Double.parseDouble(next());
	}
	//Get next int array from one line
	private static int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}
	//Get next char array from one line
	private static char[] ns() {
		return next().toCharArray();
	}
	//Get next long array from one line
	private static long[] nal(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nl();
		return a;
	}
}


Compiler output:
Main.java:44: error: unreported exception Exception; must be caught or declared to be thrown
		solve();
		     ^
1 error
Language: C++

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

int main(){
  long long n; cin >> n;
  string s; cin >> s;
  long long out = 0;
  ing flag = 0;
  for(int i = 0; i < n; i++){
    if(flag == 0 & s.at(i) == 'A') flag++;
    if(flag == 1){
      if(s.at(j) == 'B'){
        flag++;
      }else{
        flag = 0;
      }
    }
    if(flag == 2){
      if(s.at(i) == 'C'){
        out++;
        flag = 0;
      }else{
        flag = 0;
      }
    }
  }
  cout << out;
}

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

#include <iostream>
using namespace std;
int main(void){
    // Your code here!
int N;

string S;

cin>>N>>S;

int ans=0;


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

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

#include <iostream>
using namespace std;
int main(void){
    // Your code here!
int N;

string S;

cin>>N>>S;

int ans=0;


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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: expected primary-expression before 'int'
   14 | fot(int i=0;i<N-2;i++){
      |     ^~~
a.cc:14:13: error: 'i' was not declared in this scope
   14 | fot(int i=0;i<N-2;i++){
      |             ^
Language: C++

#include <iostream>
using namespace std;
int main(void){
    // Your code here!
int N;

string S;

cin>>N>>S;

int ans=0;


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

Compiler output:
a.cc:16:28: warning: multi-character literal with 11 characters exceeds 'int' size of 4 bytes
   16 |     if (S[i]=='A'&&S[i+1]=='B&&S[i+2]=='C'){
      |                            ^~~~~~~~~~~~~~
a.cc:16:42: warning: missing terminating ' character
   16 |     if (S[i]=='A'&&S[i+1]=='B&&S[i+2]=='C'){
      |                                          ^
a.cc:16:42: error: missing terminating ' character
   16 |     if (S[i]=='A'&&S[i+1]=='B&&S[i+2]=='C'){
      |                                          ^~~
a.cc: In function 'int main()':
a.cc:14:5: error: expected primary-expression before 'int'
   14 | fot(int i=0;i<N-2;i++){
      |     ^~~
a.cc:14:13: error: 'i' was not declared in this scope
   14 | fot(int i=0;i<N-2;i++){
      |             ^
a.cc: At global scope:
a.cc:27:1: error: expected unqualified-id before 'return'
   27 | return 0;
      | ^~~~~~
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:26: error: 'gets' was not declared in this scope; did you mean 'getw'?
    6 |         scanf("%d\n",&n);gets(s);
      |                          ^~~~
      |                          getw
Language: C++

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

int main(){
  string s;
  int N,ans;
  ans=0;
  cin>>N>>s;
  for(int i=0;i<N-2;i++){
    if(s.at(i)!='A')continue;
   else if(s.at(i+1)!='B')continue;
    else if(s.at(i+2)!='C')continue;
    ans++
  }
  cout<<ans<<endl;
}



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

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
 
int main()
{
	int ncount = 0;		//初始化找到相同子串的次数为0
 
	char *str1[60];
	char str2[] = "ABC";
	while (str1 = strstr(str1, str2))
	{
		ncount = ncount + 1;			//次数+1
		str1 = str1 + strlen(str2);		//str1指针指向后边的字符串（跳过n个位置（其中,str2长度 = n））
		if (*str1 == '\0')
 		{
			break;
		}
 
	};	
 
	printf("%d\n", ncount);
	system("pause");
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:30: error: passing argument 1 of 'strstr' from incompatible pointer type [-Wincompatible-pointer-types]
   11 |         while (str1 = strstr(str1, str2))
      |                              ^~~~
      |                              |
      |                              char **
In file included from main.c:3:
/usr/include/string.h:350:34: note: expected 'const char *' but argument is of type 'char **'
  350 | extern char *strstr (const char *__haystack, const char *__needle)
      |                      ~~~~~~~~~~~~^~~~~~~~~~
main.c:11:21: error: assignment to expression with array type
   11 |         while (str1 = strstr(str1, str2))
      |                     ^
main.c:14:22: error: assignment to expression with array type
   14 |                 str1 = str1 + strlen(str2);             //str1指针指向后边的字符串（跳过n个位置（其中,str2长度 = n））
      |                      ^
main.c:15:27: warning: comparison between pointer and zero character constant [-Wpointer-compare]
   15 |                 if (*str1 == '\0')
      |                           ^~
main.c:15:21: note: did you mean to dereference the pointer?
   15 |                 if (*str1 == '\0')
      |                     ^