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

#include<bits/stdc++.h>
#define fr first
#define sc second
#define vec vector
#define ms multiset
#define pb push_back
#define pll pair<ll,ll>
#define pdd pair<ld, ld>
#define pq priority_queue
#define umap unordered_map
#define uset unordered_set
#define pii pair<int, int>
#define int long long
#define fast cin.tie(0);cout.tie(0);cin.sync_with_stdio(0);cout.sync_with_stdio(0);
using namespace std;
typedef string str;
typedef long long ll;
typedef long double ld;
typedef unsigned int uint;
const int inf = 1e9+7;
const int nmax = 500005;
const ll linf = LLONG_MAX;

int n;
string s;

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

}



Compiler output:
a.cc:19:22: error: conflicting declaration 'typedef long long unsigned int uint'
   19 | typedef unsigned int uint;
      |                      ^~~~
In file included from /usr/include/stdlib.h:514,
                 from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/sys/types.h:150:22: note: previous declaration as 'typedef unsigned int uint'
  150 | typedef unsigned int uint;
      |                      ^~~~
Language: Java

import java.util.Scanner;

public class B150 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		int n = kb.nextInt();
		String s = kb.next();
		int count = 0;
		for (int i = 0; i < n - 2; i++) {
			if (s.charAt(i) == 'A' && s.charAt(i + 1) == 'B' && s.charAt(i + 2) == 'C') {
				count += 1;
			}
		}
		System.out.println(count);
		kb.close();
	}

}


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

// Contest: AtCoder Beginner Contest 150 (https://atcoder.jp/contests/abc150)
// Problem: B: Count ABC (https://atcoder.jp/contests/abc150/tasks/abc150_b)


// region {{{ boilerplate
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <chrono>
#include <cstdint>
#include <deque>
#include <exception>
#include <forward_list>
#include <functional>
#include <initializer_list>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#if __cplusplus >= 201703L
#   include <optional>
#   include <string_view>
#   include <variant>
#endif

using namespace std;

#if __cplusplus >= 201703L
#   define all(a)      begin(a),end(a)
#   define sz(x)       ((int)size(x))
#else
#   define all(a)      (a).begin(),(a).end()
#   define sz(x)       ((int)(x).size())
#endif

#define rep(a, b)      for(int a = 0; a < (b); ++a)
#define reps(a, b, c)  for(int a = (b); a < (c); ++a)
#define trav(a, b)     for(auto& a : b)

using ll = long long;
using ld = long double;
using u64 = uint64_t;
using u32 = uint32_t;

using pi = pair<int, int>;
using pl = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vpi = vector<pi>;

#if __cplusplus >= 201703L
#   define MAYBE_UNUSED [[maybe_unused]]
#else
#   define MAYBE_UNUSED
#endif

MAYBE_UNUSED static constexpr int INF = (int)1e9 + 5;
MAYBE_UNUSED static constexpr ll INFL = (ll)1e18 + 5;
MAYBE_UNUSED static mt19937 rng((u32)chrono::duration_cast<chrono::nanoseconds>(chrono::high_resolution_clock::now().time_since_epoch()).count());
//endregion }}}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n; string s; cin >> n >> s;
    int cnt = 0;
    rep(i, n - 2)
        if (s[i] = 'A' && s[i+1] == 'B' && s[i+2] == 'C)
            ++cnt;
    cout << cnt << '\n';

    return 0;
}


Compiler output:
a.cc:88:54: warning: missing terminating ' character
   88 |         if (s[i] = 'A' && s[i+1] == 'B' && s[i+2] == 'C)
      |                                                      ^
a.cc:88:54: error: missing terminating ' character
   88 |         if (s[i] = 'A' && s[i+1] == 'B' && s[i+2] == 'C)
      |                                                      ^~~
a.cc: In function 'int main()':
a.cc:90:24: error: expected ')' before ';' token
   90 |     cout << cnt << '\n';
      |                        ^
      |                        )
a.cc:88:12: note: to match this '('
   88 |         if (s[i] = 'A' && s[i+1] == 'B' && s[i+2] == 'C)
      |            ^
Language: Java

import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String str = sc.nextLine();
    int count = 0;
    for(int i = 0; i < str.length()-2;i++){
      if(str.charAt(i).equals('A')){
        if(str.charAt(i+1).equals('B')){
          if(str.charAt(i+2).equals('C')){
            count++;
          }
        }
      }
    }
    System.out.println(count);
  }
}


Compiler output:
Main.java:8: error: char cannot be dereferenced
      if(str.charAt(i).equals('A')){
                      ^
Main.java:9: error: char cannot be dereferenced
        if(str.charAt(i+1).equals('B')){
                          ^
Main.java:10: error: char cannot be dereferenced
          if(str.charAt(i+2).equals('C')){
                            ^
3 errors
Language: Java

import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String str = sc.nextLine();
    int count = 0;
    for(int i = 0; i < str.length()-2;str++){
      if(str.charAt(i).equals('A')){
        if(str.charAt(i+1).equals('B')){
          if(str.charAt(i+2).equals('C')){
            count++;
          }
        }
      }
    }
    System.out.println(count);
  }
}


Compiler output:
Main.java:7: error: bad operand type String for unary operator '++'
    for(int i = 0; i < str.length()-2;str++){
                                         ^
Main.java:8: error: char cannot be dereferenced
      if(str.charAt(i).equals('A')){
                      ^
Main.java:9: error: char cannot be dereferenced
        if(str.charAt(i+1).equals('B')){
                          ^
Main.java:10: error: char cannot be dereferenced
          if(str.charAt(i+2).equals('C')){
                            ^
4 errors
Language: Java

import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String str = sc.nextLine();
    int count = 0;
    for(int i = 0; i < str.length()-2;str++){
      if(str.charAt(i).equals("A")){
        if(str.charAt(i+1).equals("B")){
          if(str.charAt(i+2).equals("C")){
            count++;
          }
        }
      }
    }
    System.out.println(count);
  }
}


Compiler output:
Main.java:7: error: bad operand type String for unary operator '++'
    for(int i = 0; i < str.length()-2;str++){
                                         ^
Main.java:8: error: char cannot be dereferenced
      if(str.charAt(i).equals("A")){
                      ^
Main.java:9: error: char cannot be dereferenced
        if(str.charAt(i+1).equals("B")){
                          ^
Main.java:10: error: char cannot be dereferenced
          if(str.charAt(i+2).equals("C")){
                            ^
4 errors
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: 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:36: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(S.at(i) == "A" && S.at(i+1) == "B" && S.at(i+2) == "C")
      |                          ~~~~~~~~~~^~~~~~
a.cc:11:56: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(S.at(i) == "A" && S.at(i+1) == "B" && S.at(i+2) == "C")
      |                                              ~~~~~~~~~~^~~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: 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:36: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(S.at(i) == "A" && S.at(i+1) == "B" && S.at(i+2) == "C")
      |                          ~~~~~~~~~~^~~~~~
a.cc:11:56: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(S.at(i) == "A" && S.at(i+1) == "B" && S.at(i+2) == "C")
      |                                              ~~~~~~~~~~^~~~~~
a.cc:12:15: error: expected ';' before '}' token
   12 |       count ++
      |               ^
      |               ;
   13 |   }
      |   ~
Language: C++


#include <iostream>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: 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:36: 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:55: 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 <iostream>

using namespace std;

int main(){
    int N;
    cin >> N;
    string S;
    cin >> S;
    for(int i = 0;i < N;i++){
        string s1 = S[i] + S[i + 1] + S[i + 2];
        if(s1 == "ABC"){
            cout << i+1 << endl;
        }
    }
}

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

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

Compiler output:
Main.java:10: error: cannot find symbol
    if(letters[i] == 'A'){
       ^
  symbol:   variable letters
  location: class Main
Main.java:11: error: cannot find symbol
      if(letters[i+1] == 'B'){
         ^
  symbol:   variable letters
  location: class Main
Main.java:12: error: cannot find symbol
        if(letters[i+2] == 'C'){
           ^
  symbol:   variable letters
  location: class Main
3 errors
Language: C++

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

int main()
{
    int n;
    string ch;

    cin>>n>>ch;

    int cnt=0;
    int i=0;
    while(ch[i]!='\0'){
        if(ch[i]=='A'&& ch[i+1]=='B'&& ch[i+2]=='C')
            cnt++;
            i++;
    }
    printf("%d\n",cnt);
    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<stdio.h>
#include<string.h>

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

Compiler output:
main.c: In function 'main':
main.c:9:21: error: 's' undeclared (first use in this function)
    9 |         scanf("%c",&s[i]);
      |                     ^
main.c:9:21: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define whole(x) (x).begin(),(x).end()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
using ll = long long;
using P = pair<int, int>;
const int mod = 1000000007;
 
 
int main(){
  int n;
  cin >> n
    string s;
    cin >> s;
  int ans = 0;
  rep(i, n) {
    if (i==0 || i==1) continue;
    if (s[i-2]=='A' && s[i-1]=='B' && s[i]=='C') ans++;
  }
    
    
    
    
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: expected ';' before 'string'
   14 |   cin >> n
      |           ^
      |           ;
   15 |     string s;
      |     ~~~~~~ 
a.cc:16:12: error: 's' was not declared in this scope
   16 |     cin >> s;
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define whole(x) (x).begin(),(x).end()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
using ll = long long;
using P = pair<int, int>;
const int mod = 1000000007;
 
 
int main(){
  int n;
  cin >> n
    string s;
    cin >> s;
  int ans = 0;
  rep(i, n) {
    if (i==0 || i==1) continue;
    if (s[i-2]=='A' && s[i-1]=='B' && s[i]=='C') ans++;
  }
    
    
    
    
    cout << ans << endl;
    return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define whole(x) (x).begin(),(x).end()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
using ll = long long;
using P = pair<int, int>;
const int mod = 1000000007;


int main(){
    string s;
    cin >> s;
  int ans = 0;
  rep(i, s.size()) {
    if (i==0 || i==1) continue;
    if (s[i-2]=='A' && s[i-1]=='B' && s[i]=='C') ans++;
  }
    
    
    
    
    cout << ans << endl;
    return 0;
}
提出情報

Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: expected ';' before 'string'
   14 |   cin >> n
      |           ^
      |           ;
   15 |     string s;
      |     ~~~~~~ 
a.cc:16:12: error: 's' was not declared in this scope
   16 |     cin >> s;
      |            ^
a.cc: At global scope:
a.cc:37:11: error: redefinition of 'const int mod'
   37 | const int mod = 1000000007;
      |           ^~~
a.cc:9:11: note: 'const int mod' previously defined here
    9 | const int mod = 1000000007;
      |           ^~~
a.cc:40:5: error: redefinition of 'int main()'
   40 | int main(){
      |     ^~~~
a.cc:12:5: note: 'int main()' previously defined here
   12 | int main(){
      |     ^~~~
a.cc:55:1: error: '\U000063d0\U000051fa\U000060c5\U00005831' does not name a type
   55 | 提出情報
      | ^~~~~~~~
Language: C++

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

void func150b() {
  int n, ans;
  string s;
  string keyWord = "ABC";

  //しーいんキーボードからの入力受け
  cin >> n >> s;
  //長さ-3まで
  for (int i = 0; i <= n - 3; i++) {
    if (s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C') ans++;
  }
  cout << ans << endl;
}

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

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

package me.awataki;

import java.util.Scanner;

public class P39 {
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        // 配列の長さは必要ないので読み捨て
        sc.nextInt();
        String str = sc.next();
        System.out.println(str.split("ABC",-1).length -1);
    }
}


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

package me.awataki;

public class P39 {
    public static void main (String[] args) {
        Scanner sc = Util.newSc();
        // 配列の長さは必要ないので読み捨て
        sc.nextInt();
        String str = sc.next();
        System.out.println(str.split("ABC",-1).length -1);
    }
}


Compiler output:
Main.java:3: error: class P39 is public, should be declared in a file named P39.java
public class P39 {
       ^
Main.java:5: error: cannot find symbol
        Scanner sc = Util.newSc();
        ^
  symbol:   class Scanner
  location: class P39
Main.java:5: error: cannot find symbol
        Scanner sc = Util.newSc();
                     ^
  symbol:   variable Util
  location: class P39
3 errors
Language: C++

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

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

  int count = 0;
  for(int i=0;i<s.size();++i){
   
    if(i>=(s.size()-2))break;
    if(s[i]=="A"){
      if(s[i+1]=="B"){
        if(s[i+1]=="C"){
          count++ ;
        }
      }
    }else{
      continue;
    }  
  }
  cout << count << endl;
}


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

import java.util.*;

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

Compiler output:
Main.java:9: error: cannot find symbol
		System.out.println(N - S.replaceAll("ABC", "").length / 3);
		                                              ^
  symbol:   variable length
  location: class String
1 error
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((S[i]+S[i+1]+S[i+2])=="ABC"){
            count++;
        }

    }
    cout << count << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:32: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |         if((S[i]+S[i+1]+S[i+2])=="ABC"){
      |            ~~~~~~~~~~~~~~~~~~~~^~~~~~~
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(S[i]+S[i+1]+S[i+2]=="ABC"){
            count++;
        }

    }
    cout << count << endl;

}

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<bits/stdc++.h> 2 using namespace std;
3 4 int main() { 5 int n; 6 string s; 7 cin >> n >> s; 8 int ans = 0; 9 for(int i = 0; i <= n ; i++) { 10 if(s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C') ans++; 11 } 12 cout << ans << endl; 13 return 0; 14 }


Compiler output:
a.cc:1:25: warning: extra tokens at end of #include directive
    1 | #include<bits/stdc++.h> 2 using namespace std;
      |                         ^
a.cc:2:1: error: expected unqualified-id before numeric constant
    2 | 3 4 int main() { 5 int n; 6 string s; 7 cin >> n >> s; 8 int ans = 0; 9 for(int i = 0; i <= n ; i++) { 10 if(s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C') ans++; 11 } 12 cout << ans << endl; 13 return 0; 14 }
      | ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: 'A' was not declared in this scope
   10 |      if(moji[i]==A){
      |                  ^
a.cc:11:23: error: 'B' was not declared in this scope
   11 |        if (moji[i+1]==B){
      |                       ^
a.cc:12:24: error: 'C' was not declared in this scope
   12 |          if(moji[i+2]==C){
      |                        ^
Language: C++

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:18: error: initializer fails to determine size of 'moji'
    7 |    string moji[]=a;
      |                  ^
a.cc:7:18: error: array must be initialized with a brace-enclosed initializer
Language: C++

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(vec[i]=="A" && vec[i+1]=="B" && vec[i+2]=="C")
a.cc:11:31: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(vec[i]=="A" && vec[i+1]=="B" && vec[i+2]=="C")
a.cc:11:48: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(vec[i]=="A" && vec[i+1]=="B" && vec[i+2]=="C")
Language: C++

#include <iostream>
#include <string>

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

    int num = 0;
    for(int i=0, buf=0; i < n - 3; buf = ++i){
        if(s[buf] == 'A' && s[++buf] == 'B'&& s[++buf] == 'C'){
            num++;
        }
    }

    cout << num;
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'string' was not declared in this scope
    7 |     string s;
      |     ^~~~~~
a.cc:7:5: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/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:8:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |     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:9:12: error: 's' was not declared in this scope
    9 |     cin >> s;
      |            ^
a.cc:18:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   18 |     cout << num;
      |     ^~~~
      |     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 <iostream>
#include <string>

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

    int num = 0;
    for(int i = 0; i < n - 3; ++i){
        if(s[i] == 'A' && s[++i] == 'B'&& s[++i] == 'C'){
            num++;
        }
    }

    std::cout << num;
}

Compiler output:
a.cc:4:1: error: '::main' must return 'int'
    4 | void main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:6:5: error: 'string' was not declared in this scope
    6 |     string s;
      |     ^~~~~~
a.cc:6:5: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/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:7:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |     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:8:12: error: 's' was not declared in this scope
    8 |     cin >> s;
      |            ^
Language: C++



#include<iostream>
using namespace std;
int main()
{
  
  int N;
  string S;
  cin >> N >> S;
  N = S.length();
  int ans = 0;
  
  for(int i=0; i<N-2; i++){
    char A[i];
    if (A[i]=="A" and A[i+1]=="B" and A[i+2]=="C"){
      ans += ans;
    }
    
    cout << ans;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |     if (A[i]=="A" and A[i+1]=="B" and A[i+2]=="C"){
      |         ~~~~^~~~~
a.cc:16:29: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |     if (A[i]=="A" and A[i+1]=="B" and A[i+2]=="C"){
      |                       ~~~~~~^~~~~
a.cc:16:45: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |     if (A[i]=="A" and A[i+1]=="B" and A[i+2]=="C"){
      |                                       ~~~~~~^~~~~
a.cc:23:2: error: expected '}' at end of input
   23 | }
      |  ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++



#include<iostream>
using namespace std;
int main()
{
  
  int N;
  string S;
  cin >> N >> S;
  N = S.length();
  int ans = 0;
  
  for(int i=0; i<N-2; i++){
    char A[i];
    if (A[i]==A and A[i+1]==B and A[i+2]==C){
      ans += ans;
    }
    
    cout << ans;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |     if (A[i]==A and A[i+1]==B and A[i+2]==C){
      |         ~~~~^~~
a.cc:16:29: error: 'B' was not declared in this scope
   16 |     if (A[i]==A and A[i+1]==B and A[i+2]==C){
      |                             ^
a.cc:16:43: error: 'C' was not declared in this scope
   16 |     if (A[i]==A and A[i+1]==B and A[i+2]==C){
      |                                           ^
a.cc:23:2: error: expected '}' at end of input
   23 | }
      |  ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++



#include<iostream>
using namespace std;
int main()
{
  
  int N;
  string S;
  cin >> N >> S;
  N = S.length();
  int ans = 0;
  
  for(i=0; i<N-2; i++){
    char A[i];
    if (A[i]==A and A[i+1]==B and A[i+2]==C){
      ans += ans;
    }
    
    cout << ans;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:7: error: 'i' was not declared in this scope
   14 |   for(i=0; i<N-2; i++){
      |       ^
a.cc:16:9: error: 'A' was not declared in this scope
   16 |     if (A[i]==A and A[i+1]==B and A[i+2]==C){
      |         ^
a.cc:16:29: error: 'B' was not declared in this scope
   16 |     if (A[i]==A and A[i+1]==B and A[i+2]==C){
      |                             ^
a.cc:16:43: error: 'C' was not declared in this scope
   16 |     if (A[i]==A and A[i+1]==B and A[i+2]==C){
      |                                           ^
a.cc:23:2: error: expected '}' at end of input
   23 | }
      |  ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11: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++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11: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++

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

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

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

  }

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

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

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

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

  }

Compiler output:
a.cc: In function 'int main()':
a.cc:11:58: error: expected ')' before '{' token
   11 |       if(S.at(i)=='A' && S.at(i+1)=='B' && S.at(i+2)=='C'{
      |         ~                                                ^
      |                                                          )
a.cc:14:5: error: expected primary-expression before '}' token
   14 |     }
      |     ^
Language: C++

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

int main(){
  int N;
  string S;
  cin >> N >> S;
  
  int ans = 0;
  for (int i = 0;i < N-2;i++) {//N-2にしたのは配列外参照しそうだから
    if(s.substr(i,3) == "ABC") {
      ans++;
    }
  }
      cout << ans << endl;
}
       
    

Compiler output:
a.cc: In function 'int main()':
a.cc:11:8: error: 's' was not declared in this scope
   11 |     if(s.substr(i,3) == "ABC") {
      |        ^
Language: C++

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

int main(){
  int N;
  cin >> N;
  vector<char>a(N);
  rep(i,N) cin >> a[i];
  
  int count = 0;
  for(int i=1; N-1; i++){
    if( a[i-1]=="A" && a[i]=="B" && a[i+1]=="C" ) count++;
  }
  cout << count << endl;
}
      
    


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

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

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

    int n;
    string s;
    cin >> n >> s;
    int ans;
    rep(i,0,n-2){
    	if(s[i]=='A' and s[i+1]=='B' and s[i+2]=='C') ans++;
    }
    cout << ans << "\n";

    
}

Compiler output:
a.cc:1:8: error: expected constructor, destructor, or type conversion before '(' token
    1 |     rep(i,0,n-2){
      |        ^
Language: C++

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

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

    int n;
    string s;
    cin >> n >> s;
    int ans;
    rep(i,0,n-3){
    	if(s[i]=='A' and s[i+1]=='B' and s[i+2]=='C') ans++;
    }
    cout << ans << "\n";

    
}
ABCCABCBABCCABACBCBBABCBCBCBCABCB

Compiler output:
a.cc:1:3: error: stray '#' in program
    1 | 33#include <bits/stdc++.h>
      |   ^
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 33#include <bits/stdc++.h>
      | ^~
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin.tie(0);
      |     ^~~
a.cc:7:5: error: 'ios' has not been declared
    7 |     ios::sync_with_stdio(false);
      |     ^~~
a.cc:10:5: error: 'string' was not declared in this scope
   10 |     string s;
      |     ^~~~~~
a.cc:11:17: error: 's' was not declared in this scope
   11 |     cin >> n >> s;
      |                 ^
a.cc:16:5: error: 'cout' was not declared in this scope
   16 |     cout << ans << "\n";
      |     ^~~~
a.cc: At global scope:
a.cc:20:1: error: 'ABCCABCBABCCABACBCBBABCBCBCBCABCB' does not name a type
   20 | ABCCABCBABCCABACBCBBABCBCBCBCABCB
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1e9
#define PI 3.14159265359
#define MOD 1000000007
#define ALL(v) v.begin(),v.end()
typedef long long ll;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int count;
  rep(i,n-2){
    string str=substr(i,3);
    if(str=="ABC"){
      count++;
    }
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: 'substr' was not declared in this scope; did you mean 'strstr'?
   15 |     string str=substr(i,3);
      |                ^~~~~~
      |                strstr
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1e9
#define PI 3.14159265359
#define MOD 1000000007
#define ALL(v) v.begin(),v.end()
typedef long long ll;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int count;
  rep(i,n-2){
    string str=s.at(i)+s.at(i+1)+s.at(i+2);
    if(str=="ABC"){
      count++;
    }
  }
  cout << count << endl;
}


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

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

int get_int(char *line, int size) {
  if(!fgets(line, size, stdin)) return 0;
  int num;
  sscanf(line, "%d", &num);
  return num;
}

#define buf_size 53
int main(void) {

  char buf[buf_size];
  int num = get_int(buf, buf_size);
  int i, j;
  int cnt = 0;
  if(fgets(buf, buf_size, stdin) == null) return 0;

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

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


Compiler output:
main.c: In function 'main':
main.c:19:37: error: 'null' undeclared (first use in this function)
   19 |   if(fgets(buf, buf_size, stdin) == null) return 0;
      |                                     ^~~~
main.c:19:37: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

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

#include <iostream>
#include <string>

using namespace std;

int main(){

  int N;
  cin >> N;
  char moji[N];
  int ans = 0;

  for(int i = 0;i < (N-2);i++){
    if(moji[i] == "A")
      if(moji[i+1] == "B")
        if(moji[i+2] == "C")
          ans++;
  }

  cout << ans;

  return 0;
}


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

#include <iostream>
#include <string>

using namespace std;

int main(){

  int N;
  cin >> N;
  char moji[N];
  int ans = 0;

  for(int i = 0;i < N;i++){
    if(moji[i] == A)
      if(moji[i+1] == B)
        if(moji[i+2] == C)
          ans++;
  }

  cout << ans;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:19: error: 'A' was not declared in this scope
   14 |     if(moji[i] == A)
      |                   ^
a.cc:15:23: error: 'B' was not declared in this scope
   15 |       if(moji[i+1] == B)
      |                       ^
a.cc:16:25: error: 'C' was not declared in this scope
   16 |         if(moji[i+2] == C)
      |                         ^
Language: C++

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

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

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

import java.util.*;
public class Main{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    String s = sc.next();
    String t;
    int count = 0;

    for(int i=0 ; i=<s.length()-3 ; i++){
      t = s.substring(i,i+3);
      if(t.equals("ABC")){
        count++;
      }
    }
    System.out.println(count);
  }
}


Compiler output:
Main.java:10: error: > or ',' expected
    for(int i=0 ; i=<s.length()-3 ; i++){
                             ^
Main.java:10: error: -> expected
    for(int i=0 ; i=<s.length()-3 ; i++){
                               ^
Main.java:10: error: ')' expected
    for(int i=0 ; i=<s.length()-3 ; i++){
                                 ^
Main.java:10: error: ';' expected
    for(int i=0 ; i=<s.length()-3 ; i++){
                                       ^
4 errors
Language: C

#include<stdio.h>
int main(void)
{
  int i,j,l,s;
  char s[];
  
  scanf("%d",&n);
  
  scanf("%s",&s[n]);
  
  

Compiler output:
main.c: In function 'main':
main.c:5:8: error: conflicting types for 's'; have 'char[]'
    5 |   char s[];
      |        ^
main.c:4:13: note: previous declaration of 's' with type 'int'
    4 |   int i,j,l,s;
      |             ^
main.c:7:15: error: 'n' undeclared (first use in this function)
    7 |   scanf("%d",&n);
      |               ^
main.c:7:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:3: error: expected declaration or statement at end of input
    9 |   scanf("%s",&s[n]);
      |   ^~~~~
Language: Java

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

public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        String S = sc.next();

        final Solver solver = new Solver();
        solver.solve(N, S);
    }
}

class Solver {
    public void solve(int N, String X) {
        int ans = 0;
        int cur = 'a';
        for (int i = 0; i < N; i++) {
            char c = S.charAt(i);
            if (cur == c) {
                cur++;
                if (cur > 'c') {
                    ans++;
                    cur = 'a';
                }
            }
            else {
                cur = 'a';
            }
        }
        System.out.println(ans);
    }
}



Compiler output:
Main.java:12: error: incompatible types: possible lossy conversion from long to int
        solver.solve(N, S);
                     ^
Main.java:21: error: cannot find symbol
            char c = S.charAt(i);
                     ^
  symbol:   variable S
  location: class Solver
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
2 errors
Language: C

include<stdio.h>
int main(void){
  int N,i,count=0;
  char S[51];
  
  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%s",&S[i]);
  }
  for(i=0;i<N;i++){
    if(S[i+2]=='\0')break;
    else if(S[i]=='A'&&S[i+1]=='B'&&S[i+2]=='C'){
      count++;
    }
  }
  printf("%d\n",count);

  return 0;
}


Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:22:11: error: 'count' undeclared (first use in this function)
   22 |           count++;
      |           ^~~~~
main.c:22:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:58:1: error: expected declaration or statement at end of input
   58 | }
      | ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:22:11: error: 'count' undeclared (first use in this function)
   22 |           count++;
      |           ^~~~~
main.c:22:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:28:1: error: expected declaration or statement at end of input
   28 | }
      | ^
Language: C++

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


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

  int counter =0 ;
  
  for (int i=0;i<n-2;++i){
    string x = s[i]+s[i+1]+s[i+2];
    if (x == "ABC")counter ++;
  }
  
  cout <<counter<<endl;
}


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

#include <iostream>
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=0; i<n-2; ++i)
  {
    if(s[i]=="A"&&s[i+1]=="B"&&s[i+2]=="C") count++;
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc: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") count++;
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") count++;
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") count++;
Language: C++

#include <iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:15:8: error: 's' was not declared in this scope
   15 |     if(s.substr(i, 3) == "ABC") count++;
      |        ^
Language: C++

#include <iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:15:8: error: 'str' was not declared in this scope; did you mean 'std'?
   15 |     if(str.substr(i, 3) == "ABC") count++;
      |        ^~~
      |        std