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

#include <iostream>
using namespace std;
int main(){
  int R;
  cin>>R;
  if(R<1200)
    cout<<ABC<<endl;
  else if(R>=1200 && R<2800)
    cout<<ARC<<endl;
  else
    cout<<AGC<<endl;
  return 0;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: 'ABC' was not declared in this scope
    7 |     cout<<ABC<<endl;
      |           ^~~
a.cc:9:11: error: 'ARC' was not declared in this scope
    9 |     cout<<ARC<<endl;
      |           ^~~
a.cc:11:11: error: 'AGC' was not declared in this scope
   11 |     cout<<AGC<<endl;
      |           ^~~
Language: C++

#include <iostream>

using namespace std;

int main()
{
    cin>>n;
    if(n>=0 &&n<1200)
        cout<<"ABC";
    else if(n>=1200 &&n<2800)
        cout<<"ARC";
    else
        cout<<"AGC";
    return 0;
}


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

#include <iostream>
using namespace std;

int main()
{
	int a;

	cin >> a;

	if (a < 1200)
	{
		cout << "ABC";
	}
	else if (1200 <= a < 2800)
	{
		cout << "ARC";
	}
	else
	{
		cout << "AGC"
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:30: error: expected ';' before '}' token
   20 |                 cout << "AGC"
      |                              ^
      |                              ;
   21 |         }
      |         ~
Language: Java

import java.util.Scanner;

public class main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());

        if(n < 1200){
            System.out.println("ABC");
        }else if(n < 2800){
            System.out.println("ARC");
        }else{
            System.out.println("AGC");
        }
    }
}


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

#include <bits/stdc++.h>
using namespace std;
#deinfe ll long long int
#define pb push_back
#define mp make_pair
#define mod 1000000007

int main(){
    int n;
    cin>>n;
    if(n<1200){
        cout<<"ABC"<<endl;
    }
    else if(n<2800){
        cout<<"ARC"<<endl;
    }
    else{
        cout<<"AGC"<<endl;
    }
    return 0;
}

Compiler output:
a.cc:3:2: error: invalid preprocessing directive #deinfe; did you mean #define?
    3 | #deinfe ll long long int
      |  ^~~~~~
      |  define
Language: C++

#include<iostream>
#include<stdio.h>
#include<string.h>
#include<list>
#include<vector>
using namespace std;

const int SIZE = 3;

int main()
{
	int R;
	char *output = new char[SIZE];
	scanf_s("%d", &R);
	
	if (R > 0)
	{
		if (R < 1200)
		{
			output = "ABC";
		}
		else if (R < 2800)
		{
			output = "ARC";
		}
		else
		{
			output = "AGC";
		}
	}
	cout << output;
	
	delete[] output;
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   14 |         scanf_s("%d", &R);
      |         ^~~~~~~
      |         scanf
a.cc:20:34: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   20 |                         output = "ABC";
      |                                  ^~~~~
a.cc:24:34: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   24 |                         output = "ARC";
      |                                  ^~~~~
a.cc:28:34: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   28 |                         output = "AGC";
      |                                  ^~~~~
Language: C

#include<stdio.h>
 
int main(void){
  int R;
  scanf("%d",&R);
  
  if(0<=R&&R<1200){
    printf("ABC");
  }else if(1200<=R&&R<2800){
    printf("ARC");
  }else if(2800<=R&&R<=4208){
    printf("AGC");
  }
  
  return 0;

Compiler output:
main.c: In function 'main':
main.c:15:3: error: expected declaration or statement at end of input
   15 |   return 0;
      |   ^~~~~~
Language: C++

#include <chrono>
#include <set>
#include <cstdio>
#include <vector>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <cmath>

using namespace std;
typedef long long int64;
typedef unsigned long long ll;
#define fi first
#define se second

#define all(x) begin(x),end(x)
#define rall(x) rbegin(x),rend(x)
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define vec vector<int> 
#define lvec vector<ll>
#define dvec vector<double>
#define Mem(x) memset(x,0,sizeof(x));

#define rFor(i,a,b) for(int i=(a);i>(b);--i)
#define For(...)  GET_MACRO(_0,##__VA_ARGS__,For3,For2,For1,For0)(__VA_ARGS__)
#define foronce for(static int __ = 0; __ < 1;++__)
#define forall(i, s) foreach(i,begin(s),end(s))
#define foreach(i, a, b) for(auto i = (a);i!=(b) ;++i)
#define foreachn(i, a, n) for(auto i = (a),_=next(a,n);i!=_;++i)
#define For3(i,a,b) for(int i=(a);i<(b);++i)
#define For2(i,a) for(int i=0;i<(a);++i)
#define For1(a) For2(_,a)
#define For0()	

#define in(x) scanf("%d",&(x));
#define put(x) cout<<(x)<<endl;
#define GET_MACRO(_0,_1,_2,_3,_NAME,...) _NAME
#ifndef ONLINE_JUDGE
	#define out0()
	#define out1(x) {cout<<" ";cout.width(5);cout<<(x);}
	#define out2(x,y) {out1(x)out1(y)}
	#define out3(x,y,z) {out2(x,y)out1(z)}
	#define outset(x) for(auto i : x) out1(i) //std::size()
	#define outarr1(x,fir) foreachn(_iter,begin(x),fir) out1(*_iter)
	#define outarr2(x,fir,sec) for(auto iter2=begin(x);iter2!=begin(x)+fir;++iter2){ outarr1((*iter2),sec)out()}
	#define out(...) {cout<<#__VA_ARGS__<<" ";GET_MACRO(_0,##__VA_ARGS__,out3,out2,out1,out0)(__VA_ARGS__);cout<<endl;}
	#define outa(...)  {cout<<#__VA_ARGS__;out()GET_MACRO(""##__VA_ARGS__,UNUSED,outarr2,outarr1,outset)(__VA_ARGS__)out()}
#endif // ONLINE_JUDGE

const double eps = 1e9;
int mod = 222;

template<class T> T gcd(T a, T b){if(!b)return a;return gcd(b,a%b);}
#define lcm(a,b) ((ll)(a)/gcd(a,b)*(b))
inline ll powmod(ll a,ll b) {ll res=1;for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}

#include<unordered_set>

int(R)

int main(){
in(R)
if(R<1200)put("ABC")
else if(R<2800)put("ARC")
else put("AGC")
    
}


Compiler output:
a.cc:63:1: error: expected initializer before 'int'
   63 | int main(){
      | ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	int suck;
	cin>>suck;
	if(suck<=1199)
	cout<<ABC;
	if(suck<=2799)
	cout<<ARC;
	if(suck>2799)
	cout<<AGC;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: 'ABC' was not declared in this scope
    7 |         cout<<ABC;
      |               ^~~
a.cc:9:15: error: 'ARC' was not declared in this scope
    9 |         cout<<ARC;
      |               ^~~
a.cc:11:15: error: 'AGC' was not declared in this scope
   11 |         cout<<AGC;
      |               ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{

    int R;
    cin>>R;
    if(R<=1800) cout<<"ABC";
    if(R<=2800) cout<<"ARC";




Compiler output:
a.cc: In function 'int main()':
a.cc:9:29: error: expected '}' at end of input
    9 |     if(R<=2800) cout<<"ARC";
      |                             ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

function Main(input) {
  const contest = ['ABC', 'ARC', 'AGC']
  var i = 0
  var r = Number(input[0])
  if (r >= 1200) { i++ }
  if (r >= 2800) { i++ }
  console.log(contest[i])
}


Main(require("fs").readFileSync("/dev/stdin", "utf8").split('\n'))


Compiler output:
a.cc:2:20: warning: multi-character character constant [-Wmultichar]
    2 |   const contest = ['ABC', 'ARC', 'AGC']
      |                    ^~~~~
a.cc:2:27: warning: multi-character character constant [-Wmultichar]
    2 |   const contest = ['ABC', 'ARC', 'AGC']
      |                           ^~~~~
a.cc:2:34: warning: multi-character character constant [-Wmultichar]
    2 |   const contest = ['ABC', 'ARC', 'AGC']
      |                                  ^~~~~
a.cc:1:1: error: 'function' does not name a type; did you mean 'union'?
    1 | function Main(input) {
      | ^~~~~~~~
      | union
a.cc:11:5: error: expected constructor, destructor, or type conversion before '(' token
   11 | Main(require("fs").readFileSync("/dev/stdin", "utf8").split('\n'))
      |     ^
Language: C++

{
        syutu("ABC");
    }
    ruguo(r<2800){
        syutu("ARC");
    }
    ta{
        syutu("AGC");
    }
    hen 0;
}


Compiler output:
a.cc:1:1: error: expected unqualified-id before '{' token
    1 | {
      | ^
a.cc:4:10: error: expected constructor, destructor, or type conversion before '(' token
    4 |     ruguo(r<2800){
      |          ^
a.cc:7:5: error: 'ta' does not name a type
    7 |     ta{
      |     ^~
a.cc:10:5: error: 'hen' does not name a type
   10 |     hen 0;
      |     ^~~
a.cc:11:1: error: expected declaration before '}' token
   11 | }
      | ^
Language: C++

#include<iostream>
#include<cstring>
#define maxn 1000+15
using namespace std;

int main(){
	int n;
	cin>>n&&n)
		if(n<1200){
			cout<<"ABC"<<endl;
		}else if(n<2800){
			cout<<"ARC"<<endl;
		}else{
			cout<<"AGC"<<endl;
		}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: expected ';' before ')' token
    8 |         cin>>n&&n)
      |                  ^
      |                  ;
a.cc:11:18: error: 'else' without a previous 'if'
   11 |                 }else if(n<2800){
      |                  ^~~~
Language: C++

#include <string>
#include <cmath>

using namespace std;

int main(){
 int r;
 cin >> r;
 if(r < 1200){
     cout << "ABC" << endl;
 }else if(r < 2800){
     cout << "ARC" << endl;
 }else{
     cout << "AGC" << endl;
 }
  return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:2: error: 'cin' was not declared in this scope
    8 |  cin >> r;
      |  ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <cmath>
  +++ |+#include <iostream>
    3 | 
a.cc:10:6: error: 'cout' was not declared in this scope
   10 |      cout << "ABC" << endl;
      |      ^~~~
a.cc:10:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:23: error: 'endl' was not declared in this scope
   10 |      cout << "ABC" << endl;
      |                       ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include <cmath>
  +++ |+#include <ostream>
    3 | 
a.cc:12:6: error: 'cout' was not declared in this scope
   12 |      cout << "ARC" << endl;
      |      ^~~~
a.cc:12:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:12:23: error: 'endl' was not declared in this scope
   12 |      cout << "ARC" << endl;
      |                       ^~~~
a.cc:12:23: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:14:6: error: 'cout' was not declared in this scope
   14 |      cout << "AGC" << endl;
      |      ^~~~
a.cc:14:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:14:23: error: 'endl' was not declared in this scope
   14 |      cout << "AGC" << endl;
      |                       ^~~~
a.cc:14:23: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include <bits/stdc++.h>

#define forn(i, n) for (int i = 0; i < int(n); i++)
#define nfor(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define fore(i, l, r) for (int i = int(l); i < int(r); i++)
#define correct(x, y, n, m) (0 <= (x) && (x) < (n) && 0 <= (y) && (y) < (m))
#define all(a) (a).begin(), (a).end()
#define sz(a) int((a).size())
#define pb(a) push_back(a)
#define mp(x, y) make_pair((x), (y))
#define x first
#define y second

using namespace std;

typedef long long li;
typedef long double ld;
typedef pair<int, int> pti;

template<typename X> inline X abs(const X& a) { return a < 0? -a: a; }
template<typename X> inline X sqr(const X& a) { return a * a; }

template<typename A, typename B> inline ostream& operator<< (ostream& out, const pair<A, B>& p) { return out << "(" << p.x << ", " << p.y << ")"; }
template<typename T> inline ostream& operator<< (ostream& out, const vector<T>& a) { out << "["; forn(i, sz(a)) { if (i) out << ','; out << ' ' << a[i]; } return out << " ]"; }
template<typename T> inline ostream& operator<< (ostream& out, const set<T>& a) { return out << vector<T>(all(a)); }
template<typename X, typename Y> inline ostream& operator<< (ostream& out, const map<X, Y>& a) { return out << vector<pair<X, Y>>(all(a)); }
template<typename T> inline ostream& operator<< (ostream& out, const pair<T*, int>& a) { return out << vector<T>(a.x, a.x + a.y); }

inline ld gett() { return ld(clock()) / CLOCKS_PER_SEC; }

const int INF = int(1e9);
const li INF64 = li(1e18);
const ld EPS = 1e-9, PI = 3.1415926535897932384626433832795;

#ifdef SU1
//#define GEN
#ifndef GEN
#define LOG
#endif
#endif

int r;

bool read() {
  return !!(cin >> r);
}

The next contest on AtCode is called ABC, which is rated for contestants with ratings less than
1200
.

The contest after the ABC is called ARC, which is rated for contestants with ratings less than
2800
.

The contest after the ARC is called AGC, which is rated for all contestants.
void solve() {
  if (r <= 1200) puts("ABC");
  else if (r <= 2800) puts("ARC");
  else puts("AGC");
}

int main() {
#ifdef SU1
  assert(freopen("input.txt", "rt", stdin));
  //assert(freopen("output.txt", "wt", stdout));
#endif

  cout << setprecision(10) << fixed;
  cerr << setprecision(5) << fixed;

  while (read()) {
    ld stime = gett();
    solve();
#ifdef SU1
    cerr << "Time: " << gett() - stime << endl;
#endif
    //break;
  }

  return 0;
}


Compiler output:
a.cc:48:1: error: 'The' does not name a type
   48 | The next contest on AtCode is called ABC, which is rated for contestants with ratings less than
      | ^~~
a.cc: In function 'int main()':
a.cc:74:5: error: 'solve' was not declared in this scope
   74 |     solve();
      |     ^~~~~
Language: C++

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

class Main{
	public static void main(String[] ar)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
		
		int n = Integer.parseInt(br.readLine());
		if(n<1200)
          out.println("ABC");
      	else if(n>=1200 && n<2800)
          	out.println("ARC");
      	else
          	out.println("AGC");
      	out.flush();
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:15: error: expected ':' before 'static'
    5 |         public static void main(String[] ar)throws IOException{
      |               ^~~~~~~
      |               :
a.cc:5:33: error: 'String' has not been declared
    5 |         public static void main(String[] ar)throws IOException{
      |                                 ^~~~~~
a.cc:5:42: error: expected ',' or '...' before 'ar'
    5 |         public static void main(String[] ar)throws IOException{
      |                                          ^~
a.cc:5:44: error: expected ';' at end of member declaration
    5 |         public static void main(String[] ar)throws IOException{
      |                                            ^
      |                                             ;
a.cc:5:45: error: 'throws' does not name a type
    5 |         public static void main(String[] ar)throws IOException{
      |                                             ^~~~~~
a.cc:18:2: error: expected ';' after class definition
   18 | }
      |  ^
      |  ;
Language: C++

#include <iostream>
using namespace std;
void main()
{
  int R;
  string str;
  cin >> R;
  if(1200 > R)
  {
    str = "ABC";
  }else if(2800 > R)
  {
    str = "ARC";
  }else
  {
    str = "AGC";
  }
  cout << str << endl;
}

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

#include <iostream>
#include <string>
#include <set>
#include <math.h>
using namespace std;

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

    int R;

    cin >> R;

    if( 0 <= R && R <1200){
        cout << "ABC" << endl;
        return 0;
    }
    if( 1200 <= R && R <2800){
        cout << "ARC" << endl;
        return 0;
    }
    if( 2800 <= R && R <= 4208){
        cout << "AGC" << endl;
        return 0;
    }

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:24:6: error: expected '}' at end of input
   24 |     }
      |      ^
a.cc:7:41: note: to match this '{'
    7 | int main(int argc, const char * argv[]) {
      |                                         ^
Language: C++

using System;
using System.Linq;
using System.Collections.Generic;

public class Test
{
	public static void Main()
	{
		 int R = int.Parse(Console.ReadLine());
		 if(R < 1200){
			 Console.WriteLine("ABC");
		 } else if (R < 2800){
			 Console.WriteLine("ARC");
		 } else {
			 Console.WriteLine("AGC");
		 }
	}
}


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:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:5:1: error: expected unqualified-id before 'public'
    5 | public class Test
      | ^~~~~~
Language: Java

import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int R = sc.nextInt();
    String ans = "AGC";
    if(R<1200) ans = "ABC";
    if(1200<=R&&R<2800) ans = "ARC";
    System.out.println(cur);
  }
}

Compiler output:
Main.java:10: error: cannot find symbol
    System.out.println(cur);
                       ^
  symbol:   variable cur
  location: class Main
1 error
Language: C++

R = int(input())

if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    print('AGC')

Compiler output:
a.cc:4:11: warning: multi-character character constant [-Wmultichar]
    4 |     print('ABC')
      |           ^~~~~
a.cc:6:11: warning: multi-character character constant [-Wmultichar]
    6 |     print('ARC')
      |           ^~~~~
a.cc:8:11: warning: multi-character character constant [-Wmultichar]
    8 |     print('AGC')
      |           ^~~~~
a.cc:1:1: error: 'R' does not name a type
    1 | R = int(input())
      | ^
Language: Java

import java.util.*;
public class atCoder {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        // 整数の入力
        int a = sc.nextInt();
        String out = "AGC";
        if (a < 1200) {
            out = "ABC";
        } else if (a < 2800) {
            out = "ARC";
        }
        // 文字列の入力
        // String s = sc.next();
        // 出力
        System.out.println(out);
    }
}

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

#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <numeric>
#include <climits>
#include <math.h>
#include <memory.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rrep(i, k, n) for(int i = (k); i < (int)(n); i++)
//substr
using namespace std;
using ll = long long;
int N, M;
int cnt = 0;
ll ans = 0LL;
int i_index;
int dh[4] = {1, 0, -1, 0};
int dw[4] = {0, 1, 0, -1};
string board[64];

int main(){
    int R;
    cin >> R;
    if(R < 1200) cout << "ABC" << endl;
    else if(R < 2800) cout << "ARC" << endl;
    else cout << "AGC" << endl;
    r

Compiler output:
a.cc: In function 'int main()':
a.cc:30:5: error: 'r' was not declared in this scope
   30 |     r
      |     ^
a.cc:30:6: error: expected '}' at end of input
   30 |     r
      |      ^
a.cc:24:11: note: to match this '{'
   24 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int a;
    cin>>a;
    if(a<1200)cout<<ABC<<endl;
    if(1200<=a&&a<2800)cout<<ARC<<endl;
    if(2800<=a)cout<<aAGC<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:21: error: 'ABC' was not declared in this scope
    6 |     if(a<1200)cout<<ABC<<endl;
      |                     ^~~
a.cc:7:30: error: 'ARC' was not declared in this scope
    7 |     if(1200<=a&&a<2800)cout<<ARC<<endl;
      |                              ^~~
a.cc:8:22: error: 'aAGC' was not declared in this scope
    8 |     if(2800<=a)cout<<aAGC<<endl;
      |                      ^~~~
Language: C++

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

int main(){
	int n1,n2,n3,n4,n5;
	string s1,s2,s3,s4,s5;

	cin >> n1 ;

    if(n1 < 1200){
      cout <<  "ABC" << endl;
    }
    else if(n1 < 2800){ 
      cout <<  "ARC" << endl;
    }
    else{
      cout <<  "AGC"<< endl;
    }
	
	return 0;
}

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

#include <iostream>

int main(){
int x;
cin >> x;
if(x < 1200)
cout << "ABC";
else if(x < 2800)
cout << "ARC";
else
cout << "AGC";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 | cin >> x;
      | ^~~
      | 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:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 | cout << "ABC";
      | ^~~~
      | 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:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 | cout << "ARC";
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:11:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 | cout << "AGC";
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

// ConsoleApplication62.cpp : アプリケーションのエントリ ポイントを定義します。
//

#include "stdafx.h"
#include<algorithm>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include<queue>
#include<iostream>
using namespace std;



int main()
{
	long long int i, j, k, l, m, n, sum, flag, N, M;
	sum = 0;
	flag = 0;
	cin >> N;
	if (N < 1200)
		cout << "ABC" << endl;
	else if (N < 2800)
		cout << "ARC" << endl;
	else
		cout << "AGC" << endl;



    return 0;
}



Compiler output:
a.cc:4:10: fatal error: stdafx.h: No such file or directory
    4 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
#define ces(d) cout<<" "<<endl;

int main() {
 int N;
 cin >>N;
 if(N<1200){
 	ce("ABC");
 }else if(N<2800){
 	cd("ARC");
 }else{
 	cd("AGC");
 }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'cd' was not declared in this scope; did you mean 'ce'?
   20 |         cd("ARC");
      |         ^~
      |         ce
a.cc:22:9: error: 'cd' was not declared in this scope; did you mean 'ce'?
   22 |         cd("AGC");
      |         ^~
      |         ce
Language: C++

def ascan; gets.split.map(&:to_i); end

r = gets.to_i

if r <= 1199
    puts "ABC"
elsif r <= 2799
    puts "ARC"
else
    puts "AGC"
end

Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def ascan; gets.split.map(&:to_i); end
      | ^~~
a.cc:1:12: error: 'gets' does not name a type
    1 | def ascan; gets.split.map(&:to_i); end
      |            ^~~~
a.cc:1:36: error: 'end' does not name a type
    1 | def ascan; gets.split.map(&:to_i); end
      |                                    ^~~
Language: C++

#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define RREP(i,m,n) for(int i=int(n)-1;i>=int(m);--i)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long int;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;

//struct edge {int from, to, cost;};

constexpr double EPS = 1e-10;
constexpr double PI  = acos(-1.0);
//constexpr int INF = INT_MAX;

template<class T> inline T sqr(T x) {return x*x;}

void solve() {
    int n;
    cin >> n;
    if (n < 1200) cout << "ABC" << endl;
    else if (n < 2800) cout < <"ARC" << endl;
    else cout << "AGC" << endl;
}

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

Compiler output:
a.cc: In function 'void solve()':
a.cc:61:31: error: expected primary-expression before '<' token
   61 |     else if (n < 2800) cout < <"ARC" << endl;
      |                               ^
a.cc:61:38: error: invalid operands of types 'const char [4]' and '<unresolved overloaded function type>' to binary 'operator<<'
   61 |     else if (n < 2800) cout < <"ARC" << endl;
      |                                ~~~~~~^~~~~~~
Language: C++

#include <math.h>
#include <stdio.h>

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>

//コンパイラ最適化
#pragma GCC optimize("Ofast")

/*

 */
//マクロ
// forループ
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
// Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
// FORAは範囲for文(使いにくかったら消す)
#define REP(i, n) for (ll i = 0; i < ll(n); i++)
#define REPD(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i <= ll(b); i++)
#define FORD(i, a, b) for (ll i = a; i >= ll(b); i--)
#define FORA(i, I) for (const auto &i : I)
// xにはvectorなどのコンテナ
#define ALL(x) x.begin(), x.end()
#define SIZE(x) ll(x.size())
#define SORT(x) sort(x.begin(), x.end())
//定数
#define INF 1000000000000  // 10^12:∞
#define MOD 1000000007     // 10^9+7:合同式の法
#define MAXR 100000        // 10^5:配列の最大のrange
//略記
#define PB push_back  //挿入
#define MP make_pair  // pairのコンストラクタ
#define F first       // pairの一つ目の要素
#define S second      // pairの二つ目の要素

typedef long long ll;
int stringcount(string s, char c) { return count(s.cbegin(), s.cend(), c); }
using namespace std;
int main() {
  string S;
  cin >> S;
  bool flg = false;
  if (S[0] == 'A' && stringcount(S.substr(3, S.length() - 2), 'C') == 1)
    flg = true;
  if (flg)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}

Compiler output:
a.cc:41:17: error: 'string' was not declared in this scope
   41 | int stringcount(string s, char c) { return count(s.cbegin(), s.cend(), c); }
      |                 ^~~~~~
a.cc:41:17: 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:6:
/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:41:27: error: expected primary-expression before 'char'
   41 | int stringcount(string s, char c) { return count(s.cbegin(), s.cend(), c); }
      |                           ^~~~
a.cc:41:33: error: expression list treated as compound expression in initializer [-fpermissive]
   41 | int stringcount(string s, char c) { return count(s.cbegin(), s.cend(), c); }
      |                                 ^
a.cc: In function 'int main()':
a.cc:47:33: error: 'stringcount' cannot be used as a function
   47 |   if (S[0] == 'A' && stringcount(S.substr(3, S.length() - 2), 'C') == 1)
      |                      ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
  string S;
  cin>>S;
  int a=S.size();
  bool ans=true;
  if(S[0]!='A'){
      ans=false;
  }
  int cnt=0;
    for(int i=2; i<a-1; i++){
        if(S[i]=='C'){
            cnt++;
        }
    }
  	if(S[S.size()-1]=='C'){
		ans=false;
      	
    }
    if(cnt!=1){
        ans=false;      
    }
  int g=0;
  rep(i,a){
    if (isupper(S[i])){
      g++;
    }
  }
  if(g!-=2){
  ans=false;}
  if(ans==true){
      cout<<"AC"<<endl;
  }
  else{
      cout<<"WA"<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:7: error: expected ')' before '!' token
   33 |   if(g!-=2){
      |     ~ ^
      |       )
Language: C++

/*
  Problem:AT4230
*/
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#define line cout << endl
using namespace std;

string s;

bool con3 (int len) {
	for (int i = 0; i < len; i++) {
		if (i != 0 && i != cnt && s[i] >= 'A' && s[i] <= 'Z') return false;
	}
	return true;
}

int main () {
	cin >> s;
	int len = s.length ();
	int cnt;
	if (s[0] == 'A' && ((s[2] == 'C' || s[len - 2] == 'C') && (s[2] != s[len - 2]/* || len == 5*/)) && con3 (len)) {
		if (s[2] == 'C') cnt = 2;
		else cnt = len - 2;
		cout << "AC" << endl;
	}
	else cout << "WA" << endl;
	return 0;
}

Compiler output:
a.cc: In function 'bool con3(int)':
a.cc:17:36: error: 'cnt' was not declared in this scope; did you mean 'int'?
   17 |                 if (i != 0 && i != cnt && s[i] >= 'A' && s[i] <= 'Z') return false;
      |                                    ^~~
      |                                    int
Language: C++

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

int main(){
  string S;cin>>S;
  bool yes=true;
  int l=S.size();
  
  if(S.at(0)!='A') yes=false;
  if(yes){
    bool isyes=false;
    int X=0;
    for(int i=1;i<l;i++){
      if(S.at(i)-'a'<=25) X++;
      else if(S.at(i)=='C') isyes=true;
    }
    if(!isyes) yes=false;
    if(X!=l-2) yes=false;
  }
  cout<<(yes ?　"AC" :"WA")<<endl;
}

Compiler output:
a.cc:20:15: error: extended character 　 is not valid in an identifier
   20 |   cout<<(yes ?　"AC" :"WA")<<endl;
      |               ^
a.cc: In function 'int main()':
a.cc:20:15: error: '\U00003000' was not declared in this scope
   20 |   cout<<(yes ?　"AC" :"WA")<<endl;
      |               ^~
a.cc:20:17: error: expected ':' before string constant
   20 |   cout<<(yes ?　"AC" :"WA")<<endl;
      |                 ^~~~
      |                 :
a.cc:20:21: error: expected ')' before ':' token
   20 |   cout<<(yes ?　"AC" :"WA")<<endl;
      |         ~           ^~
      |                     )
Language: C++

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

int main(){
  string S;cin>>S;
  bool yes=true;
  int l=S.size();
  
  if(S.at(0)!='A') yes=false;
  if(yes){
    bool isyes=false;
    int X=0;
    for(int i=1;i<l;i++){
      if(S.at(i)-'a'<=25) X++;
      else if(S.at(i)=='C') isyes=true;
    }
    if(!isyes) yes=false;
    if(X!=l-2) yes=false;
  }
  cout<<(yes ?　"AC" :"WA")<<endl;

Compiler output:
a.cc:20:15: error: extended character 　 is not valid in an identifier
   20 |   cout<<(yes ?　"AC" :"WA")<<endl;
      |               ^
a.cc: In function 'int main()':
a.cc:20:15: error: '\U00003000' was not declared in this scope
   20 |   cout<<(yes ?　"AC" :"WA")<<endl;
      |               ^~
a.cc:20:17: error: expected ':' before string constant
   20 |   cout<<(yes ?　"AC" :"WA")<<endl;
      |                 ^~~~
      |                 :
a.cc:20:21: error: expected ')' before ':' token
   20 |   cout<<(yes ?　"AC" :"WA")<<endl;
      |         ~           ^~
      |                     )
a.cc:20:35: error: expected '}' at end of input
   20 |   cout<<(yes ?　"AC" :"WA")<<endl;
      |                                   ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,N) for (int i = 0; i < (N); ++i)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int inf{int(1e9)};

bool check(string S){
  if (S[0] != 'A') return false;
  int cnt = 0  //大文字のCがいくつあるか
  for (int i = 2; i < S.size() - 1; i++){
    if (S[i] == 'C') cnt ++;
  }
  if (cnt != 1) return false;
  int upper = 0;  //大文字の個数
  rep(i, S.size()){
    if (S[i] >= 'A' && S[i] <= 'Z') upper ++;
  }
  if (upper != 2) return false;
  return true;
}

int main(void){
  string S;
  cin >> S;

  if (check(S)){
    cout << "AC" << endl;
  }else{
    cout << "WA" << endl;
  }
}


Compiler output:
a.cc: In function 'bool check(std::string)':
a.cc:12:3: error: expected ',' or ';' before 'for'
   12 |   for (int i = 2; i < S.size() - 1; i++){
      |   ^~~
a.cc:12:19: error: 'i' was not declared in this scope
   12 |   for (int i = 2; i < S.size() - 1; i++){
      |                   ^
Language: C++

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

int main(){
  string S;
  cin>>S;
  int num=0;
  if(S[0]=='A'){
    num++;
  }
  int num_1=0;
  for(int i=2;i<S.size()-1;i++){
    if(S[i]=='C'){
      num_1++;
    }
  }
  if(num_1==1){
    num++;
  }
  int num_2=0;
  for(int i=0;i<S.size;i++){
    if(isupper(S[i])) num_2++;
  }
  if(num_2==2) num++;

  if(num==3) cout<<"AC"<<endl;
  else cout<<"WA"<<endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:19: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   21 |   for(int i=0;i<S.size;i++){
      |                 ~~^~~~
      |                       ()
Language: C++

#define rep(i,n) for (int i=0; i<(int)(n); i++)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
  string s; cin >> s;
  int sn = s.size();
  if (s[0] == 'A') {
    int cc = 0, j = 0;
    for (int i = 2; i<sn-1; i++) {
      if (s[i] == 'C') {
        j=i;
        cc++;
      }
    }
    if (cc == 1) {
      bool flag = true;
      for (int i = 1; i<sn; i++) {
        if (i==j) continue;
        if (isupper(s[i])) {
          flag = false;
          break;
        }
      }
      if (flag) {
        cout << "AC" << endl;
        return 0;
      }
    }
  }
  cout << "WA" << endl;
  return 0;
}

Compiler output:
a.cc:5:11: error: 'pair' does not name a type
    5 | using P = pair<int, int>;
      |           ^~~~
a.cc: In function 'int main()':
a.cc:8:3: error: 'string' was not declared in this scope
    8 |   string s; cin >> s;
      |   ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | #define rep(i,n) for (int i=0; i<(int)(n); i++)
a.cc:8:13: error: 'cin' was not declared in this scope
    8 |   string s; cin >> s;
      |             ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #define rep(i,n) for (int i=0; i<(int)(n); i++)
a.cc:8:20: error: 's' was not declared in this scope
    8 |   string s; cin >> s;
      |                    ^
a.cc:22:13: error: 'isupper' was not declared in this scope
   22 |         if (isupper(s[i])) {
      |             ^~~~~~~
a.cc:28:9: error: 'cout' was not declared in this scope
   28 |         cout << "AC" << endl;
      |         ^~~~
a.cc:28:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:28:25: error: 'endl' was not declared in this scope
   28 |         cout << "AC" << endl;
      |                         ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #define rep(i,n) for (int i=0; i<(int)(n); i++)
a.cc:33:3: error: 'cout' was not declared in this scope
   33 |   cout << "WA" << endl;
      |   ^~~~
a.cc:33:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:33:19: error: 'endl' was not declared in this scope
   33 |   cout << "WA" << endl;
      |                   ^~~~
a.cc:33:19: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
    string str;
    cin >> str;
    if (str[1] != 'A') {
        cout << WA << endl;
        return 0;
    }
    
    int index;
    int flag = 0;
    for (int i = 2; i < srt.size() - 1; i++) {
        if (str[i] == 'C') {
            flag = 1;
            index = i;
        }
    }
    
    int up = 0;
    
    for (int i = 1; i < str.size(); i++) {
        if (i == index) {
            continue;
        }
        if (isupper(str[i])) {
            up = 1;
        }
    }
    
    if (up == 0 && flag == 1) {
        cout << "AC" << endl;
    } else {
        cout << "WA" << endl;
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: 'WA' was not declared in this scope
    9 |         cout << WA << endl;
      |                 ^~
a.cc:15:25: error: 'srt' was not declared in this scope; did you mean 'str'?
   15 |     for (int i = 2; i < srt.size() - 1; i++) {
      |                         ^~~
      |                         str
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define REP(i, n) for (int i = 0; i < (n); i++)

const long double EPS = 1e-10;
const long long INF = 1e18;
const long double PI = acos(-1.0L);


ll gcd(ll a, ll b){  if(b==0){  return a; }   return gcd(b , a%b); }

int check_lower_case(string s){


 for(int i=0;i<s.length();i++){

   if(  s[i]>=65 && s[i] <= 91){
     return 0;
   }
 }

 return 1;

}

void solve(string s){

 int flag = 1;
 int n = s.length();

 if(s[0]!= 'A' || s[0] == 'C' || s[1] == 'C' || s[n-1] == 'C' || s[n-2] == 'C' ){
   flag = 0;
 }
 else {

  int cnt_c = 0;

  for(int i=2;i<s.length()-2;i++){
    if(s[i] =='C'){
      cnt_c++;
    }
  }
  if(cnt_c > 1){
    flag = 0;
  }

  for(int i=0;i<s.length();i++){
    if(s[i]!='A' && s[i] != 'C' && s[i] >=65 && s[i] <=91){
      flag = 0;
      break;
    }
  }

 }

 if(cnt_c == 0){
   flag = 0;
 }

 if(flag){
   cout<<"AC\n";
 }
 else{
   cout<<"WA\n";
 }

}

int main() {

string s;
cin>>s;


solve(s);

  
  return 0;
}


Compiler output:
a.cc: In function 'void solve(std::string)':
a.cc:59:5: error: 'cnt_c' was not declared in this scope
   59 |  if(cnt_c == 0){
      |     ^~~~~
Language: C++

#include<iostream>
using namespace std;

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

    len = s.length()
    string ss = s.substr(2, s.length()-2)
    
    int count = 0;
    int c_idx = 0;
    bool con = false;
    if(s[0] == 'A') {
        for (int i = 1; i < len; i++) {
            if (s.isupper()) {
                count++;
                if (s[i] == 'C' && 1 < i && i < len-1) {
                    con = true;
        }
        
    if (count == 1 && con) cout << "AC" << endl;
    else cout << "WA" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'len' was not declared in this scope; did you mean 'mblen'?
    8 |     len = s.length()
      |     ^~~
      |     mblen
a.cc:16:19: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'isupper'
   16 |             if (s.isupper()) {
      |                   ^~~~~~~
a.cc:17:17: error: 'count' was not declared in this scope; did you mean 'con'?
   17 |                 count++;
      |                 ^~~~~
      |                 con
a.cc:24:2: error: expected '}' at end of input
   24 | }
      |  ^
a.cc:15:39: note: to match this '{'
   15 |         for (int i = 1; i < len; i++) {
      |                                       ^
a.cc:24:2: error: expected '}' at end of input
   24 | }
      |  ^
a.cc:14:21: note: to match this '{'
   14 |     if(s[0] == 'A') {
      |                     ^
a.cc:24:2: error: expected '}' at end of input
   24 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char> cvec;
typedef vector<double> dvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
#define fs first
#define sc second
int main()	{
  string s;
  cin>>s;
  bool ex=false;
  if(s[0]=='A')
    ex=true;
  int n=s.size();
  int cnt=0,c=0;
  for(int i=2;i<n-1;i++){
    if(s[i]=='C')
      c++;
  }
  if(c==1) ex=true;
  rep(i,n){
    if(isupper(s[i])
       cnt++;
  }
  if(cnt==2) ex=true;
  if(ex) cout<<"AC"<<endl;
  else cout<<"WA"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:21: error: expected ';' before 'cnt'
   32 |     if(isupper(s[i])
      |                     ^
      |                     ;
   33 |        cnt++;
      |        ~~~           
a.cc:34:3: error: expected primary-expression before '}' token
   34 |   }
      |   ^
a.cc:33:14: error: expected ')' before '}' token
   33 |        cnt++;
      |              ^
      |              )
   34 |   }
      |   ~           
a.cc:32:7: note: to match this '('
   32 |     if(isupper(s[i])
      |       ^
a.cc:34:3: error: expected primary-expression before '}' token
   34 |   }
      |   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char> cvec;
typedef vector<double> dvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
#define fs first
#define sc second
int main()	{
  string s;
  cin>>s;
  bool ex=true;
  if(s[0]!='A')
    ex=false;
  int c=0,n=s.size();
  for(int i=1;i<n;i++){
    if(i>1 && i<(n-1) && s[i]=='C'){
      c++;
    }
    if(cnt>1) ex=false;
  }
  int cnt=0;
  rep(i,n){
    if(isupper(s[i]))
      cnt++;
  }
  if(cnt!=c+1){
    ex=false;
  if(ex) cout<<"AC"<<endl;
  else cout<<"WA"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:8: error: 'cnt' was not declared in this scope; did you mean 'int'?
   29 |     if(cnt>1) ex=false;
      |        ^~~
      |        int
a.cc:40:2: error: expected '}' at end of input
   40 | }
      |  ^
a.cc:18:17: note: to match this '{'
   18 | int main()      {
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char> cvec;
typedef vector<double> dvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
#define fs first
#define sc second
int main()	{
  string s;
  cin>>s;
  bool ex=true;
  if(s[0]!='A')
    ex=false;
  int cnt=0,a;
  for(int i=1;i<s.size();i++){
    if(1<i && i<s.size()-1){
      if(s[i]=='C'){
        cnt++;
        a=i;
      }
      if(cnt>1)
        ex=false;
    }
  }
  for(int i=1;i<s.size();i++){
    if(i==a) continue;
    if(isupper(s[i]){
      ex=false;
    }
  }
  if(ex) cout<<"WA"<<endl;
       else cout<<"AC"<<endl;
       }      

Compiler output:
a.cc: In function 'int main()':
a.cc:37:21: error: expected ')' before '{' token
   37 |     if(isupper(s[i]){
      |       ~             ^
      |                     )
a.cc:40:3: error: expected primary-expression before '}' token
   40 |   }
      |   ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define pi 3.14159265359
#define all(i) i.begin(),i.end()
using namespace std;
const long long INF=1e9+7;
const string alp="abcdefghijklmnopqrstuvwxyz"; //26
const string ALP="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
//const ll MOD=998244353LL;
//const ll MOD=1777777777LL;


int main() {
  string s;
  cin>>s;
  ll count=0;
  bool judge=false;
  for(int i=2;i<s.size()-1;i++){
    if(s[i]=='C'){
      count++;
    }
  }
  if(count==1) judge=true;
  if(s[0]!='A'){
    judge=false;
  }
  for(int i=0;i<s.size();i++){
    for(int ij=0;j<26;j++){
      if(s[i]!='A'&&s[i]!='C'&&s[i]==ALP[j]){
        judge=false;
      }
    }
  }
  if(judge) cout<<"AC"<<endl;
  else cout<<"WA"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:18: error: 'j' was not declared in this scope; did you mean 'ij'?
   34 |     for(int ij=0;j<26;j++){
      |                  ^
      |                  ij
Language: C++

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

int main(){
  string s;
  cin >> s;
  int n=s.size();
  int cnt=0;
  for(int i=0; i<n; i++){
    if(i==0){
      if(s[i]!='A'){
        cout << "WA" << endl;
        return 0;
      }
    }
    if(i==1) continue;
    if(2<=i && i<=n-2){
      if(s[i]=='C') cnt++;
    }
  }
  if(cnt==0) cout << "WA" << endl;
  else cout << "AC" << endl;
}

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