Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
typedef long long ll
#define rep(i,n) for(int i = 0;i<n;++i)
#define repi(itr,vec) for(auto itr = vec.begin();itr!=vec.end();++itr)
using namespace std;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
  ll n;
  string s;
  cin >> n>> s;
  ll pos = 0;
  ll ans = 0;
  while(pos<n-2){
    if(s[pos]=='A'){
      if(substr(s,pos,3)=="ABC"){
        pos+=3;
        ans+=1;
        continue;
      }
    }
    pos+=1;
  }
  cout << ans << endl;

	return 0;
}


Compiler output:
a.cc:8:1: error: expected initializer before 'using'
    8 | using namespace std;
      | ^~~~~
a.cc: In function 'int main()':
a.cc:11:9: error: 'ios' has not been declared
   11 |         ios::sync_with_stdio(false);
      |         ^~~
a.cc:12:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   12 |         cin.tie(nullptr);
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:13:3: error: 'll' was not declared in this scope
   13 |   ll n;
      |   ^~
a.cc:14:3: error: 'string' was not declared in this scope
   14 |   string s;
      |   ^~~~~~
a.cc:14: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:
/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:15:10: error: 'n' was not declared in this scope; did you mean 'yn'?
   15 |   cin >> n>> s;
      |          ^
      |          yn
a.cc:15:14: error: 's' was not declared in this scope
   15 |   cin >> n>> s;
      |              ^
a.cc:16:5: error: expected ';' before 'pos'
   16 |   ll pos = 0;
      |     ^~~~
      |     ;
a.cc:17:5: error: expected ';' before 'ans'
   17 |   ll ans = 0;
      |     ^~~~
      |     ;
a.cc:18:9: error: 'pos' was not declared in this scope; did you mean 'pow'?
   18 |   while(pos<n-2){
      |         ^~~
      |         pow
a.cc:20:10: error: 'substr' was not declared in this scope
   20 |       if(substr(s,pos,3)=="ABC"){
      |          ^~~~~~
a.cc:22:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   22 |         ans+=1;
      |         ^~~
      |         abs
a.cc:28:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   28 |   cout << ans << 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:28:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   28 |   cout << ans << endl;
      |           ^~~
      |           abs
a.cc:28:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   28 |   cout << ans << endl;
      |                  ^~~~
      |                  std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~