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

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

int main (){

string n;
int a=0;

cin >> n;

for(int i = 0; i < n.size(); i++) {
  if (n[i]==2){
  a++;
  }
}
cout << a <<endl;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namesoace'
    2 | using namesoace std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:1: error: 'string' was not declared in this scope
    6 | string n;
      | ^~~~~~
a.cc:6:1: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:9:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 | cin >> n;
      | ^~~
      | std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:8: error: 'n' was not declared in this scope
    9 | cin >> n;
      |        ^
a.cc:16:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 | cout << a <<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:16:13: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   16 | cout << a <<endl;
      |             ^~~~
      |             std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

clude<bits/stdc++.h>
using namespace std;
signed main(){
  string a;
  int b=0;
  cin>>a;
  if(a[0]=="2") b++;
  if(a[1]=="2") b++;
  if(a[2]=="2") b++;
  if(a[3]=="2") b++;
  cout<<b<<"\n";
}

Compiler output:
a.cc:1:1: error: 'clude' does not name a type
    1 | clude<bits/stdc++.h>
      | ^~~~~
a.cc: In function 'int main()':
a.cc:4:3: error: 'string' was not declared in this scope
    4 |   string a;
      |   ^~~~~~
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin>>a;
      |   ^~~
a.cc:6:8: error: 'a' was not declared in this scope
    6 |   cin>>a;
      |        ^
a.cc:11:3: error: 'cout' was not declared in this scope
   11 |   cout<<b<<"\n";
      |   ^~~~
Language: C

#include <iostream>
int main()
{
    char N[10];
    scanf("%s", N);
 
    int ans = 0;
    for (int i = 0; i < 4; ++i) {
        if (N[i] == '2') ++ans;
    }
 
    printf("%d\n", ans);
    return 0;
}

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

#include <cstdio>
 
int main()
{
    char N[10];
    scanf("%s", N);
 
    int ans = 0;
    for (int i = 0; i < 4; ++i) {
        if (N[i] == '2') ++ans;
    }
 
    printf("%d\n", ans);
    return 0;
}

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

#include <bits/stdc++.h>
 
int main()
{
    char N[10];
    scanf("%s", N);
 
    int ans = 0;
    for (int i = 0; i < 4; ++i) {
        if (N[i] == '2') ++ans;
    }
 
    printf("%d\n", ans);
    return 0;
}

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

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

int main() {
 string A;
  cin>>A;
  int N=0;
  for(int i=0; i<4; i++){
if(S.at(i)=='2')
  N++;
  }
  cout<<N<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:4: error: 'S' was not declared in this scope
    9 | if(S.at(i)=='2')
      |    ^
Language: Java

import java.util.*;

public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        String n = sc.next();
        int ans = 0;
        for(int i = 0; i < n.length(); i++) {
            if(n.chartAt(i) == '2') ans++;
        }
        System.out.println(ans);
    } 
}

Compiler output:
Main.java:9: error: cannot find symbol
            if(n.chartAt(i) == '2') ans++;
                ^
  symbol:   method chartAt(int)
  location: variable n of type String
1 error
Language: C

int main(void)
{
  int n,x=0;
  scanf("%d",&n);
  while((n>0)
        {
          if(n%10==2) x++;
          n/=10;
        }
        printf("%d",x);
        return 0;
        }

Compiler output:
main.c: In function 'main':
main.c:4:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(void)
main.c:4:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |   scanf("%d",&n);
      |   ^~~~~
main.c:4:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:5:14: error: expected ')' before '{' token
    5 |   while((n>0)
      |        ~     ^
      |              )
    6 |         {
      |         ~     
main.c:12:9: error: expected expression before '}' token
   12 |         }
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define ll long long int
#define vi vector<int>
#define vl vector<ll>
#define ppi pair<int,int>
#define ppl pair<ll,ll>
#define all(x) x.begin(),x.end()
#define ii int,int 
#define ff first    
#define ss second
#define forn(i,a,b) for(int i=a;i<b;i++)
#define forr(i,a,b) for(int i=a;i>=b;i--)
#define forv(i,m) for(auto i : m)
#define imx INT_MAX
#define imn INT_MIN
#define inf LONG_MAX
#define minf LONG_MIN
#define endl "\n"
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define sze size()
#define rvs reverse 
#define itr iterator 
#define pre cout<<fixed<<setprecision(10);
#define umap unordered_map
#define uset unordered_set

/*
#define MODM(a,b,md) ((a%md)*(b%md))%md
#define MODA(a,b,md) ((a%md)+(b%md))%md
#define ull unsigned long long int
#define si short int
*/

/*
bool compare(int a,int b) {return a > b;}
bool compare1(ppi a,ppi b) {return a.ff > b.ff;}
bool compare2(ppi a,ppi b) {return a.ss < b.ss;}
ll Npower(ll a,ll b) {ll product = 1; while(b){if(b&1){product = product*a;}a = a*a;b = b>>1;} return product;}
ll power(ll a,ll b,ll md) {ll product = 1; while(b){if(b&1){product = MODM(product,a,md);}a = MODM(a,a,md);b = b>>1;} return product%md;}
ll GCD(ll a,ll b) {return b==0 ? a:GCD(b,a%b);}
ll LCM(ll a,ll b) {return (a/GCD(a,b))*b; }
*/


int main()
{
    fast


    string str;
    cin>>str;

    int count = count(str.begin(), str.end(), '2');

    cout<<count;

   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:22: error: 'count' cannot be used as a function
   57 |     int count = count(str.begin(), str.end(), '2');
      |                 ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define print(x) cout << (x) << endl;
#define sz(x) int(x.size())
 
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const ll LLINF = 1LL<<60;
const int INF = 1<<29;
const int MOD = 1000000007;
 
void add(long long &a, long long b) {
  a += b;
  if (a >= MOD) a -= MOD;
}
 
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};


int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(10);
    string N;
    cin >> N;
    int ans = 0;
    rep(i,N.size()){
      if(N[i] == '2') ans++;
    }
    print(ans.to_string);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:15: error: request for member 'to_string' in 'ans', which is of non-class type 'int'
   37 |     print(ans.to_string);
      |               ^~~~~~~~~
a.cc:10:27: note: in definition of macro 'print'
   10 | #define print(x) cout << (x) << endl;
      |                           ^
Language: C++

#include <iostream>
using namespace std;
int main()
{
  int n, i, count=0;
  cin>>n;
  for (i=0; i<n; ++i)
  {
    if (i == 2)
    {
      cout++;
    }
  }
  cout<<count<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   11 |       cout++;
      |       ~~~~^~
Language: C++

include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define uli unsigned long long int
#define INF 999999999
#define rep(i,m,n) for(int i = m;i < n;i++)
#define pb(n) push_back(n)
#define Sort(n) sort(n.begin(), n.end())
#define Rev(n) reverse(n.begin(),n.end())
#define Out(S) cout << S << endl
#define NeOut(S) cout << S
#define HpOut(S) cout << setprecision(20) << S << endl;
#define Vecpr vector<pair<lli,lli>>
#define mod 1000000007;
bool is_prime(lli x) {
  for(lli i = 2; i * i <= x; i++) {
    if(x % i == 0) return false;
  }
  return true;
}
int main() {
  lli A,B,C=0,D=0,E=0,F=0,G=0,H=0,N,M;
  string S;
  cin >> S;
  rep(i,0,4)if(S[i]=='2')C++;
  Out(C);
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:23:3: error: 'string' was not declared in this scope
   23 |   string S;
      |   ^~~~~~
a.cc:24:3: error: 'cin' was not declared in this scope
   24 |   cin >> S;
      |   ^~~
a.cc:24:10: error: 'S' was not declared in this scope
   24 |   cin >> S;
      |          ^
a.cc:10:16: error: 'cout' was not declared in this scope
   10 | #define Out(S) cout << S << endl
      |                ^~~~
a.cc:26:3: note: in expansion of macro 'Out'
   26 |   Out(C);
      |   ^~~
a.cc:10:29: error: 'endl' was not declared in this scope
   10 | #define Out(S) cout << S << endl
      |                             ^~~~
a.cc:26:3: note: in expansion of macro 'Out'
   26 |   Out(C);
      |   ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a=0;string s;cin>>s;
  for(int i=0;i<4;i++){
    if(s.at(i)==2)a++;
  }
  cout<<a<<endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: expected '}' at end of input
    8 |   cout<<a<<endl;
      |                 ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main() {
  int ans=0;
  string s;
  cin >> s;
  if(s[0]=="2") {
    ans++;
  }
  if(s[1]=="2") {
    ans++;
  }
  if(s[2]=="2") {
    ans++;
  }
  if(s[3]=="2") {
    ans++;
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |   if(s[0]=="2") {
a.cc:12:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |   if(s[1]=="2") {
a.cc:15:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |   if(s[2]=="2") {
a.cc:18:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   18 |   if(s[3]=="2") {
Language: C++

#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main() {
  int ans=0
  string s;
  cin >> s;
  if(s[0]=="2") {
    ans++;
  }
  if(s[1]=="2") {
    ans++;
  }
  if(s[2]=="2") {
    ans++;
  }
  if(s[3]=="2") {
    ans++;
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected ',' or ';' before 'string'
    7 |   string s;
      |   ^~~~~~
a.cc:8:10: error: 's' was not declared in this scope
    8 |   cin >> s;
      |          ^
Language: Java

import java.util.*;

public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        System.out.println(scanner.next().replaceAll("[013-9]").length());
    }
}

Compiler output:
Main.java:7: error: method replaceAll in class String cannot be applied to given types;
        System.out.println(scanner.next().replaceAll("[013-9]").length());
                                         ^
  required: String,String
  found:    String
  reason: actual and formal argument lists differ in length
1 error
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <algorithm>
const int mod=1e9+7;
using LL=long long;
using std::cout;using std::endl;using std::cin;
using std::vector;using std::string;using std::set;using std::multiset;
using std::pair;using std::map;
using std::min;using std::max;
using std::make_pair;
std::ostream& operator<<(std::ostream& os,std::map<int,int>& obj){for(std::map<int,int>::iterator itr=obj.begin();itr!=obj.end();itr++){os<<itr->first<<"^"<<itr->second<<" ";}return os;}
std::ostream& operator<<(std::ostream& os,std::vector<std::map<int,int>>& obj){for(auto itr=obj.begin();itr!=obj.end();itr++){os<<*itr<<std::endl;}return os;}
std::ostream& operator<<(std::ostream& os,std::vector<int>& obj){for(auto itr=obj.begin();itr!=obj.end();itr++){os<<*itr<<endl;}return os;}

namespace ndifix{
template<class T>void sort(T &v){std::sort(v.begin(),v.end());}
}

int main(){
  string s;cin>>s;
  int ans=0;
  for(int i=;i<4;i++)if(s[i]='2')ans++;
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:13: error: expected primary-expression before ';' token
   25 |   for(int i=;i<4;i++)if(s[i]='2')ans++;
      |             ^
Language: C++

#include <iostream>
#include <string>
#include <iomanip>
#include <ios>
using namespace std;
int main(void){
  string s;
  cin >> s;
  
  int n = s.length();
  int ans = 0;
  
  for(int i=0;i<n;i++){
    if(s[i] == '2')
      ans++;
  }
  
  cou << ans << endl;
  
  return 0;
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:18:3: error: 'cou' was not declared in this scope
   18 |   cou << ans << endl;
      |   ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;con>>N;
  int ans=0;
  for(int i=0;i<4;i++){
    if(N%10==2)ans++;
    N=(N-N%10)/10;
  }
  cout<<ans<<endl;
}


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

include<bits/stdc++.h>
using namespace std;
int main(){
  int n,ans=0;
  cin >> n;
  for(int i=0;i<4;i++){
    if(n%10==2)
      ans++;
    n/=10;
  }
  cout << ans << endl;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> n;
      |   ^~~
a.cc:11:3: error: 'cout' was not declared in this scope
   11 |   cout << ans << endl;
      |   ^~~~
a.cc:11:18: error: 'endl' was not declared in this scope
   11 |   cout << ans << endl;
      |                  ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
using namespace std;
typedef long long unsigned int ll;
 
int main() {
 
  string a,b,c;
  cin >> a;
  int j=0;
  for(int i=0;i<4; i++){
    if(a[i]=='2') j++
  }
  cout << j <<endl;
   return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:22: error: expected ';' before '}' token
   14 |     if(a[i]=='2') j++
      |                      ^
      |                      ;
   15 |   }
      |   ~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(void){
  string num;
  int count = 0;
  
  cin >> str;
  
  for(int i = 0 ; i < 4 ; i++){
    if(num[i] == '2') count++;
  }
  
  cout << count << endl;
  
  return 0;
}

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

#include<bits/stdc++.h>
string s;
int c;
int main(){
  cin>>s;
  for(int i=0;i!=4;++i){
    if(s[i]=='2')++c;
  }
  cout<<c<<endl;
}

Compiler output:
a.cc:2:1: error: 'string' does not name a type; did you mean 'stdin'?
    2 | string s;
      | ^~~~~~
      | stdin
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin>>s;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 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:5:8: error: 's' was not declared in this scope
    5 |   cin>>s;
      |        ^
a.cc:9:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |   cout<<c<<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:9:12: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    9 |   cout<<c<<endl;
      |            ^~~~
      |            std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<cstdio>
#include<iostream>

using namespace std;

int main(void) {

	int n, num = 0,tmp;

	cin >> n;

	for (int k = 3; k >= 0; k--) {

		tmp = n / pow(10, k);
		if (tmp == 2)num++;

		n -= tmp * pow(10, k);


	}

	cout << num << "\n";

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:27: error: 'pow' was not declared in this scope
   14 |                 tmp = n / pow(10, k);
      |                           ^~~
Language: C++

#include <iostream>
using namespace std;

int main(){
  string s;
  int a = 0;
  cin >> s;
  for(auto i : s)
    if(i == '2')
      ++a;
  cout << a << "\n"
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: error: expected ';' before '}' token
   11 |   cout << a << "\n"
      |                    ^
      |                    ;
   12 | }
      | ~
Language: C++

program atcoder
    implicit none
    character(len=4) k
    integer :: ans=0,i
    read *,k
    do i = 1,4
        if(k(i:i)=='2')ans = ans+1
    end do
    write(*,'(I0)')ans
end program atcoder


Compiler output:
a.cc:9:13: warning: multi-character character constant [-Wmultichar]
    9 |     write(*,'(I0)')ans
      |             ^~~~~~
a.cc:1:1: error: 'program' does not name a type
    1 | program atcoder
      | ^~~~~~~
Language: C

#include <stdio.h>

int main(){
char num;
int ans=0;

for (i=0;i<4;i++) scanf("%c",&num);
if(num == '2') ans++;

printf("%d\n",ans);
}

Compiler output:
main.c: In function 'main':
main.c:7:6: error: 'i' undeclared (first use in this function)
    7 | for (i=0;i<4;i++) scanf("%c",&num);
      |      ^
main.c:7:6: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int main()
{
 	string s;
 	int sum=0;
 	cin>>s;
 	for(i=0;i<s.size();i++) 
 	{
 		if(s[i]==50) sum++;
	 }
	 cout<<sum;
	return 0;
}


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

import java.util.*;

public class Main {
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
      	int i = sc.nextInt();
        int countTwo = 0;
        while (i != 0) {
            int r = i % 10;
            i /= 10;
            if (r == 2) countTwo++;
        }
      	return countTwo;
    }
}


Compiler output:
Main.java:13: error: incompatible types: unexpected return value
      	return countTwo;
      	       ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin >> s;
  int a=0;
  for(auto a: s)
    if(t=='2')
      a++;
  cout<<a;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: 't' was not declared in this scope
    8 |     if(t=='2')
      |        ^
Language: C++

#include <iostream>
#include <string>

int main()
{
  std::string num;
  std::cin >> num;
  
  int res = 0;
  for (char c : str)
    if (c == '2')
      res++;
  std::cout << res << std::endl;
  
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: 'str' was not declared in this scope; did you mean 'std'?
   10 |   for (char c : str)
      |                 ^~~
      |                 std
Language: Java

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


public class Test {
    public static void main(String[] args) {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        try {
            String string = in.readLine();
            int amount = 0;
            for (int i = 0; i < string.length(); i++) {
                if (string.charAt(i) == '2') {
                    amount++;
                }
            }
            System.out.println(amount);
        } catch (IOException ex) {

        }
    }
}

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

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

using namespace std;
void main() {
	char a[5];
	int t = 0;
	for (int i = 0; i < 4; i++) {
		scanf("%c", &a[i]);
		if (a[i] == '2')t++;
	}
	cout << t << endl;
}

Compiler output:
a.cc:6:1: error: '::main' must return 'int'
    6 | void main() {
      | ^~~~
Language: C++

#include<iostream>
#include<string>
#include<Windows.h>
#include<stdio.h>
//#include "Header.h"
#include <string.h>

using namespace std;
void main() {
	char a[5];
	int t = 0;
	for (int i = 0; i < 4; i++) {
		scanf("%c", &a[i]);
		if (a[i] == '2')t++;
	}
	cout << t << endl;
}

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

#include<iostream>
using namespace std;

int main(){
  string a,b,c,d;
  cin >> a >> b >> c >> d;
  int i = 0;
  if(a == "2"){
    i += 1
  }
  if(b == "2"){
    i += 1
  }
  if(c == "2"){
    i += 1
  }
  if(d == "2"){
    i += 1
  }
  cout << i << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: expected ';' before '}' token
    9 |     i += 1
      |           ^
      |           ;
   10 |   }
      |   ~        
a.cc:12:11: error: expected ';' before '}' token
   12 |     i += 1
      |           ^
      |           ;
   13 |   }
      |   ~        
a.cc:15:11: error: expected ';' before '}' token
   15 |     i += 1
      |           ^
      |           ;
   16 |   }
      |   ~        
a.cc:18:11: error: expected ';' before '}' token
   18 |     i += 1
      |           ^
      |           ;
   19 |   }
      |   ~
Language: C++

int main(void){
  long int n,p,a=2,s,ans=1,i,k;
  scanf("%ld%ld",&n,&p);
  while (p>=a*a&&p!=1){
    s=0;
    while (p%a==0){
      s++;
      p/=a;
    }
    k=(s-s%n)/n;
    for (i=0;i<k;i++) ans*=a;
    a++;
  }
  printf("%ld",ans);

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'scanf' was not declared in this scope
    3 |   scanf("%ld%ld",&n,&p);
      |   ^~~~~
a.cc:14:3: error: 'printf' was not declared in this scope
   14 |   printf("%ld",ans);
      |   ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main(void){
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main() {
	string n; cin >> n; int ans = 0;
	for (int i = 0; i < 4; i++)if (n[i] == "2")ans++;
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:45: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    6 |         for (int i = 0; i < 4; i++)if (n[i] == "2")ans++;
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long int LL;

int main(){
  LL N,P;
  cin>> N>>P;
  for(LL i=pow(P,1.0/N)+1;i>=1;i--){
    if(P%(pow(i,N)==0){
      cout << i << endl;
      return 0;
  }
  
  cout << 1<< endl;
  
  
  


}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:23: error: expected ';' before '{' token
    9 |     if(P%(pow(i,N)==0){
      |                       ^
      |                       ;
a.cc:14:19: error: expected ')' before ';' token
   14 |   cout << 1<< endl;
      |                   ^
      |                   )
a.cc:9:7: note: to match this '('
    9 |     if(P%(pow(i,N)==0){
      |       ^
a.cc:20:2: error: expected '}' at end of input
   20 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

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

int main(){
  LL N,P;
  cin>> N>>P;
  for(LL i=pow(P,1.0/N)+1;i>=1;i--){
    if(P%(pow(i,N))==0){
      cout << i << endl;
      return 0;
  }
  
  cout << 1<< endl;
  
  
  


}


Compiler output:
a.cc:5:14: error: 'ul' was not declared in this scope
    5 | typedef pair<ul, ul> P;
      |              ^~
a.cc:5:18: error: 'ul' was not declared in this scope
    5 | typedef pair<ul, ul> P;
      |                  ^~
a.cc:5:20: error: template argument 1 is invalid
    5 | typedef pair<ul, ul> P;
      |                    ^
a.cc:5:20: error: template argument 2 is invalid
a.cc: In function 'int main()':
a.cc:11:9: error: invalid operands of types 'LL' {aka 'long long int'} and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
   11 |     if(P%(pow(i,N))==0){
      |        ~^~~~~~~~~~~
      |        |     |
      |        |     __gnu_cxx::__promote<double>::__type {aka double}
      |        LL {aka long long int}
a.cc:22:2: error: expected '}' at end of input
   22 | }
      |  ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <string>

int main(){
  string S;
  int A = 0;
  sin >> S;
  for(int i=0;i<S.size();i++){
    if(S[i]=='2'){
      A++;
    }
  }
  cout << A << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'string' was not declared in this scope
    5 |   string S;
      |   ^~~~~~
a.cc:5: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: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:3: error: 'sin' was not declared in this scope
    7 |   sin >> S;
      |   ^~~
a.cc:7:10: error: 'S' was not declared in this scope
    7 |   sin >> S;
      |          ^
a.cc:13:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |   cout << A << 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 << A << endl;
      |                ^~~~
      |                std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: Java

import java.util.*;
public class twelvetwentytwo {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int counter = 0;
		int len = (int)(Math.log10(n));
		while(n!=0) {
			int mod = (int)Math.pow(10, len);
			if((n-(n%mod))/mod == 2) {
				counter++;
			}
			len--;
			n = n%mod;
		}
		System.out.println(counter);
	}
}


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

#include <iostream>
#include <string>
#include <stdio.h>
using namespace std;
int main()
{
  int n;
  sld(n);
  string temp = std::to_string(n);
  char strchars[4];
  int count=0;
	strcpy(strchars, temp.c_str());
  for(int i=0;i<4;i++){
    if(strchars[i] == '2')
  		count++;
  }
   pld(count); pn
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'sld' was not declared in this scope; did you mean 'std'?
    8 |   sld(n);
      |   ^~~
      |   std
a.cc:12:9: error: 'strcpy' was not declared in this scope
   12 |         strcpy(strchars, temp.c_str());
      |         ^~~~~~
a.cc:2:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
a.cc:17:4: error: 'pld' was not declared in this scope
   17 |    pld(count); pn
      |    ^~~
a.cc:17:16: error: 'pn' was not declared in this scope; did you mean 'n'?
   17 |    pld(count); pn
      |                ^~
      |                n
Language: C

#include <stdio.h>

int main(void)
{
  int ans = 0;
  int a;
  
  scanf("%d", &a);
  
  if(a % 2000 < 1000){
    ans++;
    a = a % 2000;
  }
  if(a % 200 < 100){
    ans++;
    a = a % 200;
  }
  if(a % 20 < 10){
    ans++
    a = a % 20;
  }
  if (a % 2 == 0){
    ans++;
  }
  
  printf("%d", ans);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:10: error: expected ';' before 'a'
   19 |     ans++
      |          ^
      |          ;
   20 |     a = a % 20;
      |     ~
Language: C

#include<stdio.h>

int main() {
  int n[4];
  int c;
  for(int i = 0; i < 3; ++i)
    n[i] = getchar();
  for (i = 0; i < 3; ++i) {
    if (n[i] == 2)
      ++c;
  }
  printf("%d",c);
}

Compiler output:
main.c: In function 'main':
main.c:8:8: error: 'i' undeclared (first use in this function)
    8 |   for (i = 0; i < 3; ++i) {
      |        ^
main.c:8:8: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

using System;
using System.Linq;
class c
{
    static void Main()
    {
        Console.WriteLine(Console.ReadLine().Count(f => f == '2'));
    }
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Linq;
      |       ^~~~~~
a.cc:9:2: error: expected ';' after class definition
    9 | }
      |  ^
      |  ;
a.cc: In static member function 'static void c::Main()':
a.cc:7:9: error: 'Console' was not declared in this scope
    7 |         Console.WriteLine(Console.ReadLine().Count(f => f == '2'));
      |         ^~~~~~~
a.cc:7:52: error: 'f' was not declared in this scope
    7 |         Console.WriteLine(Console.ReadLine().Count(f => f == '2'));
      |                                                    ^
a.cc:7:55: error: expected primary-expression before '>' token
    7 |         Console.WriteLine(Console.ReadLine().Count(f => f == '2'));
      |                                                       ^
Language: C++

#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define INF 1000000000
int main(){
cin.tie(0);
ios::sync_with_stdio(false);

	string s;
	int co=0:
	cin>>s;
	REP(i,4)
		if(s[i]=='2')co++;
	
	cout<<co<<endl;

	return 0;
}
			

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: expected ',' or ';' before ':' token
   14 |         int co=0:
      |                 ^
Language: C++

#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define INF 1000000000
int main(){
cin.tie(0);
ios::sync_with_stdio(false);

	string s;
	int s=0:
	cin>>s;
	REP(i,4)
		if(s[i]=='2')co++;
	
	cout<<co<<endl;

	return 0;
}
			
		

Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: conflicting declaration 'int s'
   14 |         int s=0:
      |             ^
a.cc:13:16: note: previous declaration as 'std::string s'
   13 |         string s;
      |                ^
a.cc:17:30: error: 'co' was not declared in this scope
   17 |                 if(s[i]=='2')co++;
      |                              ^~
a.cc:19:15: error: 'co' was not declared in this scope
   19 |         cout<<co<<endl;
      |               ^~
Language: C++

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

int main() {
   string N;
   cin >> N;
 
   int K = 0;
 
   for (int i = 0; i < N.size(); i++) {
      if (N.at(i) == '2') {
        K++;
      }
   }
}
cout << K << endl;


Compiler output:
a.cc:16:1: error: 'cout' does not name a type
   16 | cout << K << endl;
      | ^~~~
Language: C++


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

int main() {
   string N;
   cin >> N;
 
   int K = 0;
 
   for (int i = 0; i < N.size(); i++) {
      if (N.at(i) == "2") {
        K++;
      }
   }
}
cout << K << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |       if (N.at(i) == "2") {
      |           ~~~~~~~~^~~~~~
a.cc: At global scope:
a.cc:17:1: error: 'cout' does not name a type
   17 | cout << K << endl;
      | ^~~~
Language: C

#include <math.h>
#include <stdio.h>
 
int main(void) {
  long n, p, i = 1, ans;
  
  scanf("%ld", &n);
  scanf("%ld", &p);
  
  while(pow(i, n) <= p) {
   if(p % pow(i, n) == 0) {
     ans = i;
   }
    i++;
  }
  
  printf("%ld", ans);
  
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:9: error: invalid operands to binary % (have 'long int' and 'double')
   11 |    if(p % pow(i, n) == 0) {
      |         ^ ~~~~~~~~~
      |           |
      |           double
Language: C++

#include <iostream>
#include <map>
using namespace std;
typedef long long int ll;

map<ll, ll> M;
ll sosuu[10000] = {
    2, 3, 5, 7, 11, 13, 17,
    19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67,
    71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113,
    127, 131, 137, 139, 149, 151, 157, 163, 167, 173,
    179, 181, 191, 193, 197, 199, 211, 223, 227, 229,
    233, 239, 241, 251, 257, 263, 269, 271, 277, 281,
    283, 293, 307, 311, 313, 317, 331, 337, 347, 349,
    353, 359, 367, 373, 379, 383, 389, 397, 401, 409,
    419, 421, 431, 433, 439, 443, 449, 457, 461, 463,
    467, 479, 487, 491, 499, 503, 509, 521, 523, 541,
    547, 557, 563, 569, 571, 577, 587, 593, 599, 601,
    607, 613, 617, 619, 631, 641, 643, 647, 653, 659,
    661, 673, 677, 683, 691, 701, 709, 719, 727, 733,
    739, 743, 751, 757, 761, 769, 773, 787, 797, 809,
    811, 821, 823, 827, 829, 839, 853, 857, 859, 863,
    877, 881, 883, 887, 907, 911, 919, 929, 937, 941,
    947, 953, 967, 971, 977, 983, 991, 997};

void disassemble(ll p, ll n)
{
    if (p == 1)
        return;

    while (p % sosuu[n] == 0)
    {
        M[sosuu[n]]++;
        p /= sosuu[n];
    }
    disassemble(p, n + 1);
}

int main()
{
    ll N, P;
    cin >> N >> P;
    ll ans = 1;

    disassemble(P, 0);

    int i = 0;
    while (sosuu[i] != 0)
    {
        if (M[sosuu[i]] >= N)
          for(int j=0;j<(M[sosuu[i]]/N);i+()
            ans *= sosuu[i];
        i++;
    }
  if(N==1){cout << P << endl;}
  else{
    cout << ans << endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:51:44: error: expected primary-expression before ')' token
   51 |           for(int j=0;j<(M[sosuu[i]]/N);i+()
      |                                            ^
a.cc:51:45: error: expected ')' before 'ans'
   51 |           for(int j=0;j<(M[sosuu[i]]/N);i+()
      |              ~                              ^
      |                                             )
   52 |             ans *= sosuu[i];
      |             ~~~
Language: C

int N=2200;
int cnt2=0;
int cntflag=0;

main(){
	while(N>0){
		N-=1000;
		cntflag++:
	}
	if(cntflag==2){
		cnt2++;
	}
	N+=1000;

	while(N>0){
		N-=100;
		cntflag++:
	}
	if(cntflag==2){
		cnt2++;
	}
	n+=100;

	while(N>0){
		N-=10;
		cntflag++:
	}
	if(cntflag==2){
		cnt2++;
	}
	n+=10;

	while(N>0){
		N-=1;
		cntflag++:
	}
	if(cntflag==2){
		cnt2++;
	}
	n+=1;
	
	return cnt2;
}

	

Compiler output:
main.c:5:1: error: return type defaults to 'int' [-Wimplicit-int]
    5 | main(){
      | ^~~~
main.c: In function 'main':
main.c:8:26: error: expected ';' before ':' token
    8 |                 cntflag++:
      |                          ^
      |                          ;
main.c:17:26: error: expected ';' before ':' token
   17 |                 cntflag++:
      |                          ^
      |                          ;
main.c:22:9: error: 'n' undeclared (first use in this function)
   22 |         n+=100;
      |         ^
main.c:22:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:26:26: error: expected ';' before ':' token
   26 |                 cntflag++:
      |                          ^
      |                          ;
main.c:35:26: error: expected ';' before ':' token
   35 |                 cntflag++:
      |                          ^
      |                          ;
Language: C++

#include <iostream>
#include <string>
int main() {
  char t = '2';
  std::string n;
  cin >> n;
  cout << (n[0] == t) + (n[1] == t) + (n[2] == t) + (n[3] == t) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> n;
      |   ^~~
      |   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:7:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |   cout << (n[0] == t) + (n[1] == t) + (n[2] == t) + (n[3] == t) << 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:7:68: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    7 |   cout << (n[0] == t) + (n[1] == t) + (n[2] == t) + (n[3] == t) << endl;
      |                                                                    ^~~~
      |                                                                    std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

// *3 or /2

#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <ios>
#include <iomanip>
#include <string>
#include <numeric>

using namespace std;

int n;

int main() {
    cin >> n;

    int res = 0;
    while (n > 0) {
        if (n % 10 == 2) {
            res++
        }
        n /= 10;
    }

    cout << res << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:18: error: expected ';' before '}' token
   23 |             res++
      |                  ^
      |                  ;
   24 |         }
      |         ~
Language: C

#include<stdio.h>
int main (){
  int n,a,b,c,d,e;
  scanf(%d,n);
  a=n/1000;
  b=(n-(a*1000))/100;
  c=(n-(a*1000)-(b*100))/10;
  d=(n-(a*1000)-(b*100)-(c*10));
  e=0;
  if(a==2){
     e++;
  }
  if(b==2){
     e++;
  }
  if(c==2){
     e++;
  }
  if(d==2){
     e++;
  }
  printf("%d\n",e);
}

Compiler output:
main.c: In function 'main':
main.c:4:9: error: expected expression before '%' token
    4 |   scanf(%d,n);
      |         ^
Language: C

#include<stdio.h>
int main (){
  int n,a,b,c,d.e;
  scanf(%d,n);
  a=n/1000;
  b=(n-(a*1000))/100;
  c=(n-(a*1000)-(b*100))/10;
  d=(n-(a*1000)-(b*100)-(c*10));
  e=0;
  if(a==2){
     e++;
  }
  if(b==2){
     e++;
  }
  if(c==2){
     e++;
  }
  if(d==2){
     e++;
  }
  printf("%d\n",e);
}

Compiler output:
main.c: In function 'main':
main.c:3:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    3 |   int n,a,b,c,d.e;
      |                ^
main.c:4:9: error: expected expression before '%' token
    4 |   scanf(%d,n);
      |         ^
main.c:8:3: error: 'd' undeclared (first use in this function)
    8 |   d=(n-(a*1000)-(b*100)-(c*10));
      |   ^
main.c:8:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:3: error: 'e' undeclared (first use in this function)
    9 |   e=0;
      |   ^
Language: C++

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

#define IOS ios::sync_with_stdio(false); cin.tie(0);

int main(void)
{
    IOS
    int n;
    cin >> n;
    vector<int> a;
    for(int i = 0; i < n; i++) {
        int x;
        cin >> x;
        a.emplace_back(x);
    }
    if (n == 1) {
        if (a[0] % 2 == 0) {
            cout << "second" << endl;
            return 0;
        } else {
            cont << "first" << endl;
            return 0;
        }
    }
    sort(a.begin(),a.end(),greater<int>());

    if ((a[0] % 2 == 0) && (a[1] % 2 == 0)) {
        cout << "second" << endl;
    } else {
        cout << "first" << endl; 
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:13: error: 'cont' was not declared in this scope; did you mean 'const'?
   23 |             cont << "first" << endl;
      |             ^~~~
      |             const
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
string str;
int ans;
cin>>str;
if(str.at(0)=="2")
ans++;
if(str.at(1)=="2")
ans++;
if(str.at(2)=="2")
ans++;
if(str.at(3)=="2")
ans++;
cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 | if(str.at(0)=="2")
      |    ~~~~~~~~~^~~~~
a.cc:10:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 | if(str.at(1)=="2")
      |    ~~~~~~~~~^~~~~
a.cc:12:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 | if(str.at(2)=="2")
      |    ~~~~~~~~~^~~~~
a.cc:14:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 | if(str.at(3)=="2")
      |    ~~~~~~~~~^~~~~
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
string str;
int ans;
cin>>str;
for(int i=0;i<4;i++){
if(str.at(i)==2)
ans++
}
cout<<ans<<endl;
}

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

#include <bits/stdc++.h>
using namespace std;
char s[6];
int main()
{
	int i,cnt=0;
	gets(s);
	for(i=0;i<strlen(s);i++)
	{
		if(s[i]=='2')
			cnt++;
	}
	printf("%d",cnt);
	return 0;
}

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

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

Compiler output:
a.cc:5:1: error: 'cin' does not name a type
    5 | cin >> N;
      | ^~~
a.cc:9:1: error: expected unqualified-id before 'for'
    9 | for (int i = 0; i < N.size(); i++) {
      | ^~~
a.cc:9:17: error: 'i' does not name a type
    9 | for (int i = 0; i < N.size(); i++) {
      |                 ^
a.cc:9:31: error: 'i' does not name a type
    9 | for (int i = 0; i < N.size(); i++) {
      |                               ^
a.cc:14:1: error: 'cout' does not name a type
   14 | cout << K << endl;
      | ^~~~
Language: C++

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

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

string N;
cin >> N;

int K = 0;

for (int i = 0; i < N.size(); i++) {
   if (N.at(i) == "2") {
     K++;
   }
}
cout << K << endl;


Compiler output:
a.cc:8:1: error: 'cin' does not name a type
    8 | cin >> N;
      | ^~~
a.cc:12:1: error: expected unqualified-id before 'for'
   12 | for (int i = 0; i < N.size(); i++) {
      | ^~~
a.cc:12:17: error: 'i' does not name a type
   12 | for (int i = 0; i < N.size(); i++) {
      |                 ^
a.cc:12:31: error: 'i' does not name a type
   12 | for (int i = 0; i < N.size(); i++) {
      |                               ^
a.cc:17:1: error: 'cout' does not name a type
   17 | cout << K << endl;
      | ^~~~
Language: C++

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

string N;
cin >> N;

int K = 0;

for (int i = 0; i < N.size(); i++) {
   if (N.at(i) == "2") {
     K++;
   }
}
cout << K << endl;


Compiler output:
a.cc:5:1: error: 'cin' does not name a type
    5 | cin >> N;
      | ^~~
a.cc:9:1: error: expected unqualified-id before 'for'
    9 | for (int i = 0; i < N.size(); i++) {
      | ^~~
a.cc:9:17: error: 'i' does not name a type
    9 | for (int i = 0; i < N.size(); i++) {
      |                 ^
a.cc:9:31: error: 'i' does not name a type
    9 | for (int i = 0; i < N.size(); i++) {
      |                               ^
a.cc:14:1: error: 'cout' does not name a type
   14 | cout << K << endl;
      | ^~~~
Language: C++

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

string N;
cin >> N;

int K = 0;

for (int i = 0; i < N.size(); i++;) {
   if (N.at(i) == "2") {
     K++;
   }
}
cout << K << endl;


Compiler output:
a.cc:5:1: error: 'cin' does not name a type
    5 | cin >> N;
      | ^~~
a.cc:9:1: error: expected unqualified-id before 'for'
    9 | for (int i = 0; i < N.size(); i++;) {
      | ^~~
a.cc:9:17: error: 'i' does not name a type
    9 | for (int i = 0; i < N.size(); i++;) {
      |                 ^
a.cc:9:31: error: 'i' does not name a type
    9 | for (int i = 0; i < N.size(); i++;) {
      |                               ^
a.cc:9:35: error: expected unqualified-id before ')' token
    9 | for (int i = 0; i < N.size(); i++;) {
      |                                   ^
a.cc:14:1: error: 'cout' does not name a type
   14 | cout << K << endl;
      | ^~~~
Language: C

#include <stdio.h>
int main(){
char a[4];
int b=0;
scanf("%s",a);
for(int i=0;i<4;i++){
if(char a[i]==2){
b++;
}
}
printf("%d",&b);
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:7:4: error: expected expression before 'char'
    7 | if(char a[i]==2){
      |    ^~~~