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


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

int main(){
  int N;
  string M;
  cin>>N;
  cin>>M;
  size_t n=M.count("ABC");
  cout<<n<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'count'
   12 |   size_t n=M.count("ABC");
      |              ^~~~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'n' was not declared in this scope
   12 |   n=M.count(M.begin(),M.end(),"ABC");
      |   ^
a.cc:12:7: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'count'
   12 |   n=M.count(M.begin(),M.end(),"ABC");
      |       ^~~~~
a.cc:13:9: error: expected primary-expression before '>' token
   13 |   cout<<>M.count<<endl;
      |         ^
a.cc:13:12: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'count'
   13 |   cout<<>M.count<<endl;
      |            ^~~~~
Language: C++

#include <algorithm>
#include <iostream>
#include <vector>
#include <istream>
namespace std;

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


Compiler output:
a.cc:5:14: error: expected '{' before ';' token
    5 | namespace std;
      |              ^
a.cc: In function 'int main()':
a.cc:9:3: error: 'string' was not declared in this scope
    9 |   string M;
      |   ^~~~~~
a.cc:9:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:2:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:10:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   10 |   cin>>N;
      |   ^~~
      |   std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:11:8: error: 'M' was not declared in this scope
   11 |   cin>>M;
      |        ^
a.cc:12:3: error: 'count' was not declared in this scope; did you mean 'std::count'?
   12 |   count(M.begin(),M.end(),"ABC");
      |   ^~~~~
      |   std::count
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:1:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: 'std::count' declared here
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
a.cc:13:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |   cout<<count<<endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:13:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   13 |   cout<<count<<endl;
      |                ^~~~
      |                std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:11: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'subster'; did you mean 'substr'?
   12 |     if (s.subster(i,3) == "ABC") ++ans;
      |           ^~~~~~~
      |           substr
Language: C++

#include<iostream>
#include <string>
#include <algorithm>

using namespace std;
typedef long long ll;


int main(){
    int n;
    int count = 0;
    string str;
    cin >> n;
    cin >> str;

    for (int i = 0; i < n; i++) {
        if (str[i] == 'A') {
            if (str[i + 1] == 'B') {
                if (str[i + 2] == 'C') {
                    count++;
                }
            }
        }
    }
    cout << count << endl;

    return

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:8: error: storage size of 's' isn't known
    6 |   char s[]; cin >> s;
      |        ^
Language: C++

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


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

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

package main

import (
	"fmt"
	"regexp"
)

func main() {
	var n int
	var s string
	fmt.Scan(&n, &s)

	r := regexp.MustCompile(`ABC`)
	fmt.Println(len(r.FindAllStringSubmatch(s, -1)))
}


Compiler output:
a.cc:13:33: error: stray '`' in program
   13 |         r := regexp.MustCompile(`ABC`)
      |                                 ^
a.cc:13:37: error: stray '`' in program
   13 |         r := regexp.MustCompile(`ABC`)
      |                                     ^
a.cc:1:1: error: 'package' does not name a type
    1 | package main
      | ^~~~~~~
Language: C++

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

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


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

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

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


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

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

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


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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'A' was not declared in this scope
   11 |     if(S.at(i)==A && S.at(i+1)==B && S.at(i++2)==C){
      |                 ^
a.cc:11:33: error: 'B' was not declared in this scope
   11 |     if(S.at(i)==A && S.at(i+1)==B && S.at(i++2)==C){
      |                                 ^
a.cc:11:46: error: expected ')' before numeric constant
   11 |     if(S.at(i)==A && S.at(i+1)==B && S.at(i++2)==C){
      |                                          ~   ^
      |                                              )
a.cc:11:50: error: 'C' was not declared in this scope
   11 |     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>>S;
  int s=0;
  for(int i=0;i<N;i++){
    if(S.at(i)=="A" && S.at(i+1)=="B" && S.at(i++2)=="C"){
      s++;
    }
  }
  cout<<s<<endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(S.at(i)=="A" && S.at(i+1)=="B" && S.at(i++2)=="C"){
      |        ~~~~~~~^~~~~
a.cc:11:33: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(S.at(i)=="A" && S.at(i+1)=="B" && S.at(i++2)=="C"){
      |                        ~~~~~~~~~^~~~~
a.cc:11:50: error: expected ')' before numeric constant
   11 |     if(S.at(i)=="A" && S.at(i+1)=="B" && S.at(i++2)=="C"){
      |                                              ~   ^
      |                                                  )
a.cc:11:52: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(S.at(i)=="A" && S.at(i+1)=="B" && S.at(i++2)=="C"){
      |                                          ~~~~~~~~~~^~~~~
Language: C++

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

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;

typedef long long ll;
typedef long double ld; 
typedef double db; 
typedef string str; 

typedef pair<int, int> pi;
typedef pair<ll,ll> pl; 
typedef pair<ld,ld> pd; 

typedef vector<int> vi; 
typedef vector<ll> vl;
typedef vector<ld> vd; 
typedef vector<str> vs; 
typedef vector<pi> vpi;
typedef vector<pl> vpl; 

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define trav(a,x) for (auto& a: x)

#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)

#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound 
#define ub upper_bound 

const int MOD = 998244353;
const ll INF = 1e18;
const int MX = 1000001;

int N, S;

int main() {
	cin.sync_with_stdio(0); cin.tie(0);
    cin >> N >> S;
    int ans = 0;
    F0R(i, N - 2) {
        ans += (S[i] == 'A' && S[i + 1] == 'B' && S[i + 2] == 'C');
    }
    cout << ans;
    return 0;
    // You should actually read the stuff at the bottom
}

/* Stuff to Look For
 * -----------------
 * Int overflow, array bounds
 * Initializing all variables, avoid weird behavior
 * Edge cases(n = 0, n = 1)
 * Just return 0 after result
 */


Compiler output:
a.cc: In function 'int main()':
a.cc:48:18: error: invalid types 'int[int]' for array subscript
   48 |         ans += (S[i] == 'A' && S[i + 1] == 'B' && S[i + 2] == 'C');
      |                  ^
a.cc:48:33: error: invalid types 'int[int]' for array subscript
   48 |         ans += (S[i] == 'A' && S[i + 1] == 'B' && S[i + 2] == 'C');
      |                                 ^
a.cc:48:52: error: invalid types 'int[int]' for array subscript
   48 |         ans += (S[i] == 'A' && S[i + 1] == 'B' && S[i + 2] == 'C');
      |                                                    ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <climits>
#include <unordered_map>
#include <vector>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: invalid types 'int[int]' for array subscript
   15 |     if(S[i] == 'A' ){
      |         ^
a.cc:16:11: error: invalid types 'int[int]' for array subscript
   16 |       if(S[i+1] == 'B'){
      |           ^
a.cc:17:13: error: invalid types 'int[int]' for array subscript
   17 |         if(S[i+2] == 'C'){
      |             ^
Language: C++

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

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


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

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

const ll INF = 1001001001;

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



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

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7


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:6:13: warning: multi-character character constant [-Wmultichar]
    6 | INF = float('inf')
      |             ^~~~~
a.cc:22:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   22 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
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<n-2;i++){
    string tmp;
    tmp = s.sbstr(i,3);
    if(tmp == "ABC") cnt++;
  }
  cout << cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'sbstr'; did you mean 'substr'?
   11 |     tmp = s.sbstr(i,3);
      |             ^~~~~
      |             substr
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();
    int count = 0;
    
    for (int i = 0; i < N-2 ;i++) {
      ABC = S.substring(i, i + 3);
    }
    System.out.print(count);
  }
}

Compiler output:
Main.java:11: error: cannot find symbol
      ABC = S.substring(i, i + 3);
      ^
  symbol:   variable ABC
  location: class Main
1 error
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: 'A' was not declared in this scope
   10 |     if(S.at(i)==A&&S.at(i+1)==B&&S.at(i+2)==C)
      |                 ^
a.cc:10:31: error: 'B' was not declared in this scope
   10 |     if(S.at(i)==A&&S.at(i+1)==B&&S.at(i+2)==C)
      |                               ^
a.cc:10:45: error: 'C' was not declared in this scope
   10 |     if(S.at(i)==A&&S.at(i+1)==B&&S.at(i+2)==C)
      |                                             ^
Language: 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();
    char[] c = s.charAt();
    int ans = 0;

    for(int i = 0; i < n - 2; i++){
      if(c[i] == 'A' && c[i + 1] == 'B' && c[i + 2] == 'C'){
        ans += 1;
      }
    }

    System.out.println(ans);
  }
}


Compiler output:
Main.java:9: error: method charAt in class String cannot be applied to given types;
    char[] c = s.charAt();
                ^
  required: int
  found:    no arguments
  reason: actual and formal argument lists differ in length
1 error
Language: C++

n = int(input())
s = input()
count = 0
for i in range(n - 2):
  if s[i] + s[i + 1] + s[i + 2] == 'ABC':
    count += 1
print(count)

Compiler output:
a.cc:5:36: warning: multi-character character constant [-Wmultichar]
    5 |   if s[i] + s[i + 1] + s[i + 2] == 'ABC':
      |                                    ^~~~~
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: C++

#include <iostream>
using namespace std;

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


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

#include <iostream>
using namespace std;

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

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

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


Compiler output:
Main.java:8: error: ')' expected
        for(int i=0;i<a-2;i++){if(s.substring(i,i+3).equals("ABC"){b++;
                                                                  ^
1 error
Language: C++

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


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: expected unqualified-id before 'public'
    2 | public class Main {
      | ^~~~~~
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 str = sc.next();
      	Integer cnt = 0;
      	Integer flag = 0;
		for(int i=0; i < N; i++){
          if((flag==0)&&(str.charAt(i)==A)){
          	flag = 1;
            continue;
          }
          if((flag==1)&&(str.charAt(i)==B)){
          	flag = 2;
            continue;
          }
          if((flag==2)&&(str.charAt(i)==C)){
            cnt++;
          	flag = 0;
            continue;
          }
          flag = 0;
        }
		System.out.println(cnt);
      	return;
	}
}


Compiler output:
Main.java:10: error: cannot find symbol
          if((flag==0)&&(str.charAt(i)==A)){
                                        ^
  symbol:   variable A
  location: class Main
Main.java:14: error: cannot find symbol
          if((flag==1)&&(str.charAt(i)==B)){
                                        ^
  symbol:   variable B
  location: class Main
Main.java:18: error: cannot find symbol
          if((flag==2)&&(str.charAt(i)==C)){
                                        ^
  symbol:   variable C
  location: class Main
3 errors
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 str = sc.nextString();
      	Integer cnt = 0;
      	Integer flag = 0;
		for(int i=0; i < N; i++){
          if((flag==0)&&(str.charAt(i)=="A")){
          	flag = 1;
            continue;
          }
          if((flag==1)&&(str.charAt(i)=="B")){
          	flag = 2;
            continue;
          }
          if((flag==2)&&(str.charAt(i)=="C")){
            cnt++;
          	flag = 0;
            continue;
          }
          flag = 0;
        }
		System.out.println(cnt);
      	return;
	}
}


Compiler output:
Main.java:6: error: cannot find symbol
      	String str = sc.nextString();
      	               ^
  symbol:   method nextString()
  location: variable sc of type Scanner
Main.java:10: error: bad operand types for binary operator '=='
          if((flag==0)&&(str.charAt(i)=="A")){
                                      ^
  first type:  char
  second type: String
Main.java:14: error: bad operand types for binary operator '=='
          if((flag==1)&&(str.charAt(i)=="B")){
                                      ^
  first type:  char
  second type: String
Main.java:18: error: bad operand types for binary operator '=='
          if((flag==2)&&(str.charAt(i)=="C")){
                                      ^
  first type:  char
  second type: String
4 errors
Language: C

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

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

    int sum = 0;
    for (int i = 0; i < s.size(); i++){
        if (s.substr(i, 3) == "ABC") {
            sum++;
        }
    }
    cout << sum << endl;
}

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

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

    }
    cout << ans << endl;
 }


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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'i' was not declared in this scope
    9 |   int A[i];
      |         ^
a.cc:10:32: error: 'A' was not declared in this scope
   10 |   for (int i=0; i<N; i++) cin>>A[i];
      |                                ^
a.cc:13:5: error: 'A' was not declared in this scope
   13 | if (A[i]=='A' && A[i+1]=='B' && A[i+2]=='C') sum++;
      |     ^
a.cc:15:4: error: expected '}' at end of input
   15 |   }
      |    ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'A' was not declared in this scope
   11 | if (A[i]=='A' && A[i+1]=='B' && A[i+2]=='C') sum++;
      |     ^
a.cc:13:4: error: expected '}' at end of input
   13 |   }
      |    ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C

#include <stdio.h>
int main(void){
int n;
int c = 0;
char s;
scanf("%d",&n);
getchar (s);
{if ('ABC' in s)c++;
printf("%d",c);
}
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:7:1: error: too many arguments to function 'getchar'
    7 | getchar (s);
      | ^~~~~~~
In file included from main.c:1:
/usr/include/stdio.h:582:12: note: declared here
  582 | extern int getchar (void);
      |            ^~~~~~~
main.c:8:6: warning: multi-character character constant [-Wmultichar]
    8 | {if ('ABC' in s)c++;
      |      ^~~~~
main.c:8:11: error: expected ')' before 'in'
    8 | {if ('ABC' in s)c++;
      |     ~     ^~~
      |           )
Language: C

#include <stdio.h>
int main(void){
int n;
int c = 0;
char s;
scanf("%d",&n);
getchar s;
{if ('ABC' in s)c++;
printf("%d",c);
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:8: error: expected ';' before 's'
    7 | getchar s;
      |        ^~
      |        ;
main.c:8:6: warning: multi-character character constant [-Wmultichar]
    8 | {if ('ABC' in s)c++;
      |      ^~~~~
main.c:8:11: error: expected ')' before 'in'
    8 | {if ('ABC' in s)c++;
      |     ~     ^~~
      |           )
Language: C++

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

using ll=long long;
const ll MOD=1000000007;

int main() {
  int n;
  string s;
  cin >> n >> s;
  int cnt=0;
  for(int i=0;i<n-2;i++){
    if(a[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:8: error: 'a' was not declared in this scope
   13 |     if(a[i]=='A'&&a[i+1]=='B'&&a[i+2]=='C')
      |        ^
Language: C++

#include <bits/stdc++.h>
#define ll long long

using namespace std;

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

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: expected unqualified-id before 'int'
    7 |     string s = "", int length = 0;
      |                    ^~~
a.cc:9:12: error: 'length' was not declared in this scope
    9 |     cin >> length >> s;
      |            ^~~~~~
Language: C++

#include <bits/stdc++.h>
#define ll long long

using namespace std;

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

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: expected unqualified-id before 'int'
    7 |     string s, int length;
      |               ^~~
a.cc:9:12: error: 'length' was not declared in this scope
    9 |     cin >> length >> s;
      |            ^~~~~~
Language: C++

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


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

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

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()
{
  long long int n,k=0;
  cin>>s;
  string a;
  cin>>a;
  for(int i=0;i<n-3;i++)
  {
    if(a[i]=='A' && a[i+1]=='B' && a[i+2]=='C')
    {
      k+=1;
      i+=2;
    }
  }
  cout<<k;
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:6:8: error: 's' was not declared in this scope
    6 |   cin>>s;
      |        ^
Language: C++

#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
using namespace std;

namespace adaptor = boost::adaptors;

void Main()
{
	int N;
    string S;
    cin >> N >> S;

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

int main()
{
	std::cin.tie(nullptr);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	
	Main();
}

Compiler output:
a.cc:2:9: fatal error: boost/multi_array.hpp: No such file or directory
    2 | #include<boost/multi_array.hpp>
      |         ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
using namespace std;

namespace adaptor = boost::adaptors;

void Main()
{
	int N, S;
    cin >> N >> S;

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

int main()
{
	std::cin.tie(nullptr);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	
	Main();
}

Compiler output:
a.cc:2:9: fatal error: boost/multi_array.hpp: No such file or directory
    2 | #include<boost/multi_array.hpp>
      |         ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
using namespace std;

namespace adaptor = boost::adaptors;

void Main()
{
	int N, S;
    cin >> N >> S;

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

int main()
{
	std::cin.tie(nullptr);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	
	Main();
}

Compiler output:
a.cc:2:9: fatal error: boost/multi_array.hpp: No such file or directory
    2 | #include<boost/multi_array.hpp>
      |         ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
using namespace std;

namespace adaptor = boost::adaptors;

void Main()
{
	int N, S;
    cin >> N >> S;

    int count = 0;
    string flag = 0;
    for (int i = 0; i < N; i++) {
		if(flag == 0) {
            if(count[i] == 'A') {
                flag = 1;
            }
        } else if(flag == 1) {
            if(count[i] == 'B') {
                flag = 2;
            } else {
                flag = 0;
            }
        } else if(flag == 2) {
            if(count[i] == 'C') {
                flag = 0;
                count++
            } else {
                flag = 0;
            }
        }
	}
}

int main()
{
	std::cin.tie(nullptr);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	
	Main();
}

Compiler output:
a.cc:2:9: fatal error: boost/multi_array.hpp: No such file or directory
    2 | #include<boost/multi_array.hpp>
      |         ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

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



Compiler output:
a.cc: In function 'int main()':
a.cc:11:1: error: 'else' without a previous 'if'
   11 | else 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 >> S;
  int ans = 0;
  
  for(int i = 0;i < N;i ++){
    
    if(S[i] == "A" && S[2] == "B" && S[3] == "C") ans++;
    
  }
  
  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[2] == "B" && S[3] == "C") ans++;
a.cc:12:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |     if(S[i] == "A" && S[2] == "B" && S[3] == "C") ans++;
a.cc:12:43: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |     if(S[i] == "A" && S[2] == "B" && S[3] == "C") ans++;
Language: C++

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


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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: expected '}' at end of input
   11 |   cout << ans << endl;
      |                       ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
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 + 2 < N) {
            if (S.at(i) == "A" && S.at(i + 1) == "B" && S.at(i + 2) == "C") {
                count++;
            }
        }
    }

    cout << count << endl;
}


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

import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    int prev = S.lenght();
    S = S.replace("ABC", "");
    int sum = (prev - S.length())/3;
    System.out.println(sum);
  }
}

    

      
    

Compiler output:
Main.java:6: error: cannot find symbol
    int prev = S.lenght();
                ^
  symbol:   method lenght()
  location: variable S of type String
1 error
Language: C++

#include "stdafx.h" 
#include <iostream>
#include <string>

using namespace std;

void func150b()
{
    int n;
    string s;
    cin >> n;
    cin >> s;

    //ここでsの中にあるABCを数える
    int num = 0;
   // for (int i = 0; i <= n - 3; ++i) {
     //   if (s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C') num++;
    //}
    for (int i = 0; (i= s.find((string) "ABC",i)) != string::npos; ++i) {
        num++;
    }
    cout << num << endl;
}

int main()
{
  func150b();
  return 0;
}

Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
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++

#include <iostream>

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

  int count = 0;
  for (int i = 2; i < str.size(); ++i) {
    if (str.at(i - 2) == 'A' && str.at(i - 1) == 'B' && str.at(i) == 'C') {
      ++count;  
    }
  }
  std::cout << cout << std::endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |   std::cout << cout << std::endl;
      |                ^~~~
      |                std::cout
In file included from a.cc:1:
/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>
#include<string>
using namespace std;

int main() {
	int N;
	string S;

	cin >> N;
	
	cin >> S;
	
	int cow = 0;

	for (int i = 0; i < N; i++) {
		if (S.at(i) = 'A' && S.at(i + 1) = 'B' && S.at(i + 2) = 'C') {
			cow++;
		}
	}

	cout << cow << endl;

}

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

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




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

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




Compiler output:
a.cc: In function 'int main()':
a.cc:12:12: 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:25: 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:38: 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:16:4: error: expected '}' at end of input
   16 |   }
      |    ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

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

int main(){
    int n;cin>>n;
    string s;cin>>s;
    int c=0
    for(string::iterator i=s.begin();i<s.end()-2;i++){
        if(s[i]=="A"&&s[i+2]=="C") c++;
    }
    cout<<c<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: expected ',' or ';' before 'for'
    9 |     for(string::iterator i=s.begin();i<s.end()-2;i++){
      |     ^~~
a.cc:9:38: error: 'i' was not declared in this scope
    9 |     for(string::iterator i=s.begin();i<s.end()-2;i++){
      |                                      ^
Language: C++

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

int main(){
    int n;cin>>n;
    string s;cin>>s;
    int c=0
    for(string::iterator i=s.begin();i<s.end()-2;i++){
        if(s[i]=="A"&&a[i+2]=="C") c++;
    }
    cout<<c<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: expected ',' or ';' before 'for'
    9 |     for(string::iterator i=s.begin();i<s.end()-2;i++){
      |     ^~~
a.cc:9:38: error: 'i' was not declared in this scope
    9 |     for(string::iterator i=s.begin();i<s.end()-2;i++){
      |                                      ^
Language: C++

#include<iostream>
#include<queue>
using namespace std;
queue <string> que;
string s;
	cin >> s;
	que.push(s);
	cout << que;

Compiler output:
a.cc:6:9: error: 'cin' does not name a type
    6 |         cin >> s;
      |         ^~~
a.cc:7:9: error: 'que' does not name a type
    7 |         que.push(s);
      |         ^~~
a.cc:8:9: error: 'cout' does not name a type
    8 |         cout << que;
      |         ^~~~
Language: C++

#include <iostream>
#include <map>
#include <queue>
#include <vector>
#include <set>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <cmath>
#define INF 1000000007
using namespace std ;

int main(int argc, char const *argv[])
{

	int n ;
	string s ;
	cin>>n>>s ;
	int ans = 0 ; 
	for(int i = 0 ; i < n ; i+=3)
	{
		if(s.susbstr(i,i+3) == "ABC") ++ans ;
	}

	cout<<ans<<endl ; 
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:22:22: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'susbstr'; did you mean 'substr'?
   22 |                 if(s.susbstr(i,i+3) == "ABC") ++ans ;
      |                      ^~~~~~~
      |                      substr