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

#include <iostream>
using namespace std;
int main(){
  string S; cin >> S;
  int cnt = 0;
  if(S.at(0) != 'A'){
    cout << "WA" << endl;
    return 0;
  }
  if(S.at(1) == '
  for(int i = 1; i < S.size(); i++){
    if(S.at(i) == 'C'){
      cnt++;
    }
    else if( i >= 2 and i <= S.size() - 2 and'a' > S.at(i) or S.at(i) > 'z'){
      cout << "WA" << endl;
      return 0;
    }
    
    if(cnt >1){
      cout << "WA" << endl;
      return 0;
    }
  }
  if(cnt == 1)
  	cout << "AC" << endl;
  else
    cout << "WA" << endl;
  

}

Compiler output:
a.cc:10:17: warning: missing terminating ' character
   10 |   if(S.at(1) == '
      |                 ^
a.cc:10:17: error: missing terminating ' character
a.cc: In function 'int main()':
a.cc:11:3: error: expected primary-expression before 'for'
   11 |   for(int i = 1; i < S.size(); i++){
      |   ^~~
a.cc:10:16: error: expected ')' before 'for'
   10 |   if(S.at(1) == '
      |     ~          ^
      |                )
   11 |   for(int i = 1; i < S.size(); i++){
      |   ~~~           
a.cc:11:18: error: 'i' was not declared in this scope
   11 |   for(int i = 1; i < S.size(); i++){
      |                  ^
Language: C++

#include <iostream>

using namespace std;

int main()
{string s;
int c=0,cc=0,a=0;
cin>>s;
if(s[0]!='A'||s[1]=='C'){cout<<"WA"<<endl;}
else{
for(int i=2;i<s.size()-1;i++){
    if(s[i]=='C'){c++;}

    
}
for(int i=0;i<s.size();i++){
    if(s[i]>96&&s[i]<123){a++;}
}

if((c==0||c>1||(a!=s.size()-2)){cout<<"WA"<<endl;}
else{cout<<"AC"<<endl;}
}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:32: error: expected ')' before '{' token
   20 | if((c==0||c>1||(a!=s.size()-2)){cout<<"WA"<<endl;}
      |   ~                            ^
      |                                )
a.cc:22:1: error: expected primary-expression before '}' token
   22 | }
      | ^
Language: C++

#include <iostream>

using namespace std;

int main()
{string s;
int c=0,cc=0;
cin>>s;
if(s[0]!='A'||(s[1]=='c'||s[1]=='C'||s[1]=='a')){cout<<"WA"<<endl;}
else{
for(int i=2;i<s.size();i++){
    if(s[i]=='C'){c++;}
    else if{s[i]=='A'}{cc++;}
    else if(s[i]=='c'||s[i]=='a'){cc++;}
}
if((c==0||c>1)||cc>0){cout<<"WA"<<endl;}
else{cout<<"AC"<<endl;}
}
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: expected '(' before '{' token
   13 |     else if{s[i]=='A'}{cc++;}
      |            ^
      |            (
a.cc:14:5: error: 'else' without a previous 'if'
   14 |     else if(s[i]=='c'||s[i]=='a'){cc++;}
      |     ^~~~
Language: Java

import java.util.*;
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scn = new Scanner(System.in);
		String s = scn.next();
      	int check = 0;
		if (s.charAt(0) != 'A') {
			check = 1;
		}
      	if (s.charAt(1) == 'C') {
			check = 1;
		}
		int count =0;
		for (int i=2;i<s.length-1; ++i) {
			if (s.charAt(i)=='C') {
				count = count + 1;
			}
		}
		if (count != 1) {
			check = 1;
		}
		for (int i=1;i<s.length; ++i) {
			if (s.charAt(i)!='C' && (s.charAt(i)<'a' || s.charAt(i)>'z')) {
				check = 1;
			}
		}
      if(check == 0){
		System.out.println("AC");
      }else{
        System.out.println("WA");
      }
	}
}


Compiler output:
Main.java:14: error: cannot find symbol
		for (int i=2;i<s.length-1; ++i) {
		                ^
  symbol:   variable length
  location: variable s of type String
Main.java:22: error: cannot find symbol
		for (int i=1;i<s.length; ++i) {
		                ^
  symbol:   variable length
  location: variable s of type String
2 errors
Language: Java

import java.util.*;
import java.math.BigInteger;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String slist[] = s.split("");
		for(int i = 0; i < slist.length; i++){
		    if(slist[i].equal("A")){
		        if(i > 1 && i < slist.length-1 && slist[i].equal("C")){
		            if()
		        }
		        }
		    }
		}
		}
    }
}

Compiler output:
Main.java:11: error: illegal start of expression
		            if()
		               ^
Main.java:12: error: illegal start of statement
		        }
		        ^
Main.java:17: error: class, interface, enum, or record expected
    }
    ^
3 errors
Language: C++

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:20: error: 'cnt' was not declared in this scope; did you mean 'cntC'?
   13 |     if(s[i] == 'C')cnt++;
      |                    ^~~
      |                    cntC
a.cc:15:6: error: 'cnt' was not declared in this scope; did you mean 'cntC'?
   15 |   if(cnt > 1 || cnt == 0){
      |      ^~~
      |      cntC
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++)
using namespace std;
using P = pair<int, int>; 
using ll = long long;

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

  string ans = "AC";
  if(s[0] != 'A'){
    ans = "WA";
  }
  int cnt = 0, m;
  for(int = 2; i <= s.size() - 2; i++){
    if(s[i] == 'C') {
      cnt++;
      m = i;
    }
  }
  if(cnt != 1) ans = "WA";
    rep(i,s.size()){
      if (i == 0 || i == m) continue;
      if(s[i] < 'a' || s[i] > 'z') ans = "WA";
    }
  
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:11: error: expected unqualified-id before '=' token
   18 |   for(int = 2; i <= s.size() - 2; i++){
      |           ^
a.cc:18:10: error: expected ';' before '=' token
   18 |   for(int = 2; i <= s.size() - 2; i++){
      |          ^~
      |          ;
a.cc:18:11: error: expected primary-expression before '=' token
   18 |   for(int = 2; i <= s.size() - 2; i++){
      |           ^
a.cc:18:16: error: 'i' was not declared in this scope
   18 |   for(int = 2; i <= s.size() - 2; i++){
      |                ^
a.cc:18:33: error: expected ')' before ';' token
   18 |   for(int = 2; i <= s.size() - 2; i++){
      |      ~                          ^
      |                                 )
a.cc:18:35: error: 'i' was not declared in this scope
   18 |   for(int = 2; i <= s.size() - 2; i++){
      |                                   ^
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++)
using namespace std;
using P = pair<int, int>; 
using ll = long long;

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

  string ans = "AC";
  if(s[0] != 'A'){
    ans = "WA";
  }
  else if(s[2] != 'C' && s[s.size() - 2] != 'C' || s[2] == 'C' && s[s.size() - 2] == 'C') {
    if (s.size() != 4) ans = "WA";
  }
  if{
    rep(i,s.size()){
      if (i == 0 || i == 2 || i == s.size() - 2) continue;
      if(s[i] < 'a' || s[i] > 'z') ans = "WA";
    }
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:5: error: expected '(' before '{' token
   20 |   if{
      |     ^
      |     (
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main() {
    string s;
    cin >> s;
    int x, d;
    x = s.length();
    bool a, b, c;
    a = (s[0] == 'A');
    for(int i = 2; i < x - 1 ; i++){
        if(s[i] == 'C') d++;
    }
    b = (d == 1);
    for(int i = 1; i < x; i++){
        if(s[i] >= 97 && s[i] <= 122) d++;
    }
    c = (x - 1 == d)
    if(a && b && c){
        cout << "AC" << endl;
    }
    else{
        cout << "WA" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:21: error: expected ';' before 'if'
   18 |     c = (x - 1 == d)
      |                     ^
      |                     ;
   19 |     if(a && b && c){
      |     ~~               
a.cc:22:5: error: 'else' without a previous 'if'
   22 |     else{
      |     ^~~~
Language: C++

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

int main() {
   string S;
   cin >> S;
   string T = S.substr(2, S.size()-3);
   int count = 0;
   rep(i, T.size()) if( T[i] == 'C' ) count++;
   int o = 0;
   rep(i, S.size()) if( S[i] < 'a' || S[i] > 'z' ) o++;
   if( S.substr(0,1) == "A" && count == 1 && o = 2 ) cout << "AC" << endl;
   else cout << "WA" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:43: error: lvalue required as left operand of assignment
   14 |    if( S.substr(0,1) == "A" && count == 1 && o = 2 ) cout << "AC" << endl;
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
Language: C++

#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<climits>//long long型の最大値(LLONG_MAX)など
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列

using namespace std;
typedef long long ll;
typedef long double ld;

#define rep(i,n) for(ll i=0;i<(ll)(n);i++)

bool isLower(char c){
    if(c - 'a' < 26){
        return true;
    }else{
        return false;
    }
}

int main() {
    string S;
    cin >> S;
    ll size = S.size();

    if(S[0] != 'A'){
        cout << "WA" << endl;
        return 0;
    }
    ll count = 0;
    for(ll i=2;i<size-1;i++){
        if(S[i] == 'C'){
            count++;
        }
    }
    if(count != 1){
        cout << "WA" << endl;
        return 0;
    }

    count=0;
    rep(i,size){
        ll temp = S[i] - 'a'
        // if('A'<=S[i] && S[i]<='Z'){
        if(0 <= temp && temp < 26){
            count++;
        }
    }
    if(count == 2){
        cout << "AC" << endl;
    }else{
        cout << "WA" << endl;
    }



}



Compiler output:
a.cc: In function 'int main()':
a.cc:60:9: error: expected ',' or ';' before 'if'
   60 |         if(0 <= temp && temp < 26){
      |         ^~
Language: C++


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

int main() {
   string S;
   cin >> S;
   string T = S.substr(2, S.size()-2);
   int count = 0;
   rep(i, T.size()){ if( T[i] == "C" ) count++;}
   if( S.head() == "A" && count == 1 ) cout << "AC" << endl;
   else cout << "WA" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:31: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |    rep(i, T.size()){ if( T[i] == "C" ) count++;}
a.cc:13:10: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'head'
   13 |    if( S.head() == "A" && count == 1 ) cout << "AC" << endl;
      |          ^~~~
Language: C++

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

int main() {
   string S;
   cin >> S;
   string T = S.substr(2, S.size()-2);
   int count = 0;
   rep(i, T.size()) if( T[i] == "C" ) count++;
   if( S.head() == "A" && count == 1 ) cout << "AC" endl;
   else cout << "WA" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:30: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |    rep(i, T.size()) if( T[i] == "C" ) count++;
a.cc:12:10: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'head'
   12 |    if( S.head() == "A" && count == 1 ) cout << "AC" endl;
      |          ^~~~
a.cc:12:52: error: expected ';' before 'endl'
   12 |    if( S.head() == "A" && count == 1 ) cout << "AC" endl;
      |                                                    ^~~~~
      |                                                    ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  //最初がAじゃなかったらWA
  if(s.at(i) != 'A') {
    cout << "WA" << endl;
  }
  //Jが2以上あったらWA,あと1個目の添字はtにとっとく
  int j=0,t=0;
  for(int i=3; i<s.size()-1) {
    if(j == 0) {
      j++;
      t = i;
    } else {
      cout << "WA" << endl;
      return 0;
    }
  }
  //もしCが一個もなかったらWA
  if(j == 0) {
    cout << "WA" << endl;
    return 0;
  }
  //先にAとCをのぞいておく
  s.erase(0,1);
  s.erase(t-1,1);
  //AとCをのぞいた文字列を一個ずつ調べる
  //もし英小文字じゃないのが一つでもあったらWA
  for(int i=0; i<s.size(); i++) {
    if(!(s.at(i) >= 'a' && s.at(i) <= 'z')) {
      cout << "WA" << endl;
      return 0;
    }
  }
  //全部OKならAC
  cout << "AC" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: 'i' was not declared in this scope
    7 |   if(s.at(i) != 'A') {
      |           ^
a.cc:12:28: error: expected ';' before ')' token
   12 |   for(int i=3; i<s.size()-1) {
      |                            ^
      |                            ;
Language: Java

ソースコード 

Copy
Copy
import java.util.*;
import java.math.BigInteger;
 
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        int countC = 0;
        int count = 0;
        
        if(str.charAt(0) == 'A' && !Character.isUpperCase(str.charAt(1))){
            //System.out.println("test");
            for(int i=2; i<str.length()-1; i++){
                if(str.charAt(i) == 'C'){
                    countC++;
                   //System.out.println("test1");
                }
                if(Character.isUpperCase(str.charAt(i))){
                    count++;
                    //System.out.println("test2");
                }
                if(countC > 1 || count >1){
                    //System.out.println("test3");
                    break;
                }
            }
        }else{
            
        }
        
        if(countC==1 && !Character.isUpperCase(str.charAt(str.length()-1))){
            System.out.println("AC");
        }else{
            System.out.println("WA");
        }
    }
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
?????? 
^
Main.java:6: error: class, interface, enum, or record expected
import java.math.BigInteger;
^
2 errors
Language: Java

import java.util.*;
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    String[] AC = S.split(""); //1文字ずつ分割
    boolean ans = true; 
    int cnt = 0;
    
    if(AC[0].equals("A")){//1文字目＝A
      for(int i = 1; i < AC.length; i++)
        if(AC[i].toUpperCase().equals(AC[i])){//大文字の数
          if(i == 1 || i == AC.length-1){
            ans = false;
          }else{
            if(AC[i].equals("C")){//3文字目までにCが含まれる
              cnt ++;
            }else{
              ans = false;
            }
          }
        }
      }
    }else{
      ans = false;
    }
    if(cnt != 1){
      ans = false;
    }
        if(ans){
            System.out.println("AC");
        }else{
            System.out.println("WA");
        }
    }
}


Compiler output:
Main.java:24: error: illegal start of type
    }else{
     ^
Main.java:27: error: illegal start of type
    if(cnt != 1){
    ^
Main.java:27: error: <identifier> expected
    if(cnt != 1){
          ^
Main.java:30: error: illegal start of type
        if(ans){
        ^
Main.java:30: error: <identifier> expected
        if(ans){
              ^
Main.java:32: error: illegal start of type
        }else{
         ^
Main.java:36: error: class, interface, enum, or record expected
}
^
7 errors
Language: C++

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

int main() {
	string S;
	cin >> S;
	bool AC=true;
	if (S.[0]!='A') AC=false;
	int count=0;
	for (int i=2; i<S.length()-1; i++){
	    if (S.[i]=='C') count++;
	}
	if (count!=1) AC=false;
	int COUNT=0;
	for (int i=0; i<S.length(); i++){
	    if (S[i]>='A' && S[i]<='Z') COUNT++;
	}
	if (COUNT!=2) AC=false;
	if (AC) cout << "AC" << endl;
	else cout << "WA" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: expected unqualified-id before '[' token
    8 |         if (S.[0]!='A') AC=false;
      |               ^
a.cc:11:19: error: expected unqualified-id before '[' token
   11 |             if (S.[i]=='C') count++;
      |                   ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<ll, P> PP;

static const double EPS = 1e-8;
static const double PI = 4.0 * atan(1.0);
static const ll INF = 1023456789;

#define REP(i,n)	for(int i=0;i<n;++i)
#define REPR(i,n)	for(int i=n-1;i>=0;--i)
#define FOR(i,s,n)	for(int i=s;i<n;++i)
#define FORR(i,s,n)	for(int i=n-1;i>=s;--i)
#define ALL(c)		(c).begin(),(c).end()
#define CLEAR(v)	memset(v,0,sizeof(v))
#define MP(a,b)		make_pair((a),(b))
#define ABS(a)		((a)>0?(a):-(a))
#define F			first
#define S			second

int main(int argc, char **argv) {
	string s;
	cin >> s;
	bool f = true;
	f &= (s[0] == 'A');
	ll c = 0;
	REP(i, n) if (s[i] >= 'a' && s[i] <= 'z') ++c;
	f &= (c == s.length() - 2);
	FOR(i, 2, n) if (s[i] == 'C') {
		cout << "AC" << endl;
		return 0;
	}
	cout << "WA" << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:31:16: error: 'n' was not declared in this scope
   31 |         REP(i, n) if (s[i] >= 'a' && s[i] <= 'z') ++c;
      |                ^
a.cc:14:39: note: in definition of macro 'REP'
   14 | #define REP(i,n)        for(int i=0;i<n;++i)
      |                                       ^
a.cc:33:19: error: 'n' was not declared in this scope
   33 |         FOR(i, 2, n) if (s[i] == 'C') {
      |                   ^
a.cc:16:39: note: in definition of macro 'FOR'
   16 | #define FOR(i,s,n)      for(int i=s;i<n;++i)
      |                                       ^
Language: C++

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



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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: expected initializer before '==' token
   11 |     int c == 0;
      |           ^~
a.cc:13:26: error: 'c' was not declared in this scope
   13 |           if(s[i] == 'C')c++;
      |                          ^
a.cc:16:23: error: 'c' was not declared in this scope
   16 |     if(s[0] == 'A' && c == 1){
      |                       ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: expected ')' before '{' token
   13 |   if(isupper(s[1]) {
      |     ~             ^~
      |                   )
a.cc:17:18: error: 'i' was not declared in this scope
   17 |   for(int i = 2; i < s.size() - 1; i++) {
      |                  ^
Language: Java

import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;

public class Main_ {
  public static void main(final String[] args) {
    final Scanner sc = new Scanner(System.in);
    final String sNum = sc.next();
    final String[] sArray = sNum.split("");
    final List<String> listStr = new LinkedList<String>();
    boolean bResult = false;
    String sResult;
    int listSize = 0;
    int iResultCnt = 0;
    for (int ii = 0; ii < sArray.length; ii++) {

      // 小文字かどうか比較
      if (!sArray[ii].toLowerCase().equals(sArray[ii])) {
        if (ii == 0 && "A".equals(sArray[ii])) {
          bResult = true;
          continue;
        }

        // 先頭から3文字目 かつ 末尾から2文字目の間
        if (ii >= 2 && ii <= sArray.length - 2) {
          if ("C".equals(sArray[ii])) {
            iResultCnt++;
            continue;
          }
        } else {
          if ("C".equals(sArray[ii])) {
            iResultCnt++;
            continue;
          }
        }
      } else {
        listStr.add(sArray[ii]);
      }
    }
    listSize = listStr.size();
    if (bResult && 1 == iResultCnt && sArray.length - 2 == listSize) {
      sResult = "AC";
    } else {
      sResult = "WA";
    }
    System.out.print(sResult);
  }
}


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

import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;

public class Main_ {
  public static void main(final String[] args) {
    final Scanner sc = new Scanner(System.in);
    final String sNum = sc.next();
    final String[] sArray = sNum.split("");
    final List<String> listStr = new LinkedList<String>();
    boolean bResult = false;
    String sResult;
    int listSize = 0;
    int iResultCnt = 0;
    for (int ii = 0; ii < sArray.length; ii++) {

      // 小文字かどうか比較
      if (!sArray[ii].toLowerCase().equals(sArray[ii])) {
        if (ii == 0 && "A".equals(sArray[ii])) {
          bResult = true;
          continue;
        }

        if (ii == 1 && "C".equals(sArray[ii])) {
          iResultCnt++;
          continue;
        }

        // 先頭から3文字目 かつ 末尾から2文字目の間
        if (ii >= 2 && ii <= sArray.length - 2) {
          if ("C".equals(sArray[ii])) {
            iResultCnt++;
            continue;
          }
        } else {
          listStr.add(sArray[ii]);
        }
      } else {
        listStr.add(sArray[ii]);
      }
    }
    listSize = listStr.size();
    if (bResult && 1 == iResultCnt && sArray.length - 2 == listSize) {
      sResult = "AC";
    } else {
      sResult = "WA";
    }
    System.out.print(sResult);
  }
}


Compiler output:
Main.java:5: 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;
int main(){
    string S;
    cin >> S;
    if(S[0]!='A'){
        cout << "WA" << endl;
        retrun 0;
    }
    else{
        int flag=0;
        int flag2=0;
        for(int i=1;i<S.length();i++){
            if(i>=2 && i<S.length()-1 && S[i]=='C')flag++;
            else if((int)(S[i]-'a')<0 || (int)(S[i]-'a')>26)flag2++;
        }
        if(flag!=1 && flag2>0)cout << "WA" << endl;
        else cout << "AC" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'retrun' was not declared in this scope
    8 |         retrun 0;
      |         ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
 //Now sorting a vector looks like sort(all(vec)) 
//instead of sort(vec.begin(), vec.end()).

typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef vector<double> vd;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<string> vs;

#define ios                         ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fori(n) for(int i=0; i<int(n); i++)
#define cins(s) string s; cin>>s;
#define cini(i) int i; cin>>i;
#define cind(d) double d; cin>>d;
#define cinai(a, n) vi a(n); fori(n) { cin>>a[i]; }
#define cinas(s, n) vs s(n); fori(n) { cin>>s[i]; }
#define cinad(a, n) vd a(n); fori(n) { cin>>a[i]; }
#define watch(x) cout << (#x) << " is " << (x) << endl
#define see(x) cout << (x) << " ";
#define hh cout << "\n";
typedef long long int ll;
#define vll vector < ll > 
#define fo(i, n) for(i=0; i<n; i++)
#define Fo(i, k, n) for(i=k; i<n; i++)
int32_t main(){
    ios
    
        int n,i,j,f=0,dwn=0;
        string s;
        cin>>s;
        n=s.length();
        
        if(s[0]!='A')
        {
            dwn=1;
            see("WA")
        }
        else{
            
         
            i=0;
            while(i<n)
            {
                char ch=s[i];
                
                if( (islower(ch)) && (ch=='a' || ch=='c'))
                {
                     dwn=1;
                    see("WA")
                    break;
                }
                
                if(ch=='C' && (i<n-1 && i>1))
                {
                    f++;
                }else if(ch=='C' && (i<2 || i>n-2)) {
                    
                    dwn=1;
                    see("WA")
                    break;
                }
                
                if(f>1)
                {
                    dwn=1;
                    see("WA")
                    break;
                }
                i++;
            }
        }
        
        if(f==0 && dwn==0)
        {
            dwn=1;
            see("WA")
            break;
        }
        
        if(dwn==0)
        see("AC")
        
      
      
        
} 	

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:83:13: error: break statement not within loop or switch
   83 |             break;
      |             ^~~~~
Language: C++

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

int main(){
  string s;
  cin >> s;
  string ans = "AC";
  
  if(a.at(0) != 'A'){
    ans = "WA";
  }
  int count = 0;
  for(int i = 1; i < s.size(); i++){
    if(isupper(s.at(i))){
      if(i == 1 || i == s.size() - 1 || s.at(i) != 'C'){
        ans = "WA";
      }
      count++;
    }
  }
  if(count != 1){
    ans = "WA";
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:6: error: 'a' was not declared in this scope
    9 |   if(a.at(0) != 'A'){
      |      ^
Language: C++

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

int main(){
  string s;
  cin >> s;
  int ans = "AC";
  
  if(a.at(0) != 'A'){
    ans = "WA";
  }
  int count = 0;
  for(int i = 1; i < s.size(); i++){
    if(isupper(s.at(i))){
      if(i == 1 || i == s.size() - 1 || s.at(i) != 'C'){
        ans = "WA";
      }
      count++;
    }
  }
  if(count != 1){
    ans = "WA";
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
    7 |   int ans = "AC";
      |             ^~~~
      |             |
      |             const char*
a.cc:9:6: error: 'a' was not declared in this scope
    9 |   if(a.at(0) != 'A'){
      |      ^
a.cc:10:11: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   10 |     ans = "WA";
      |           ^~~~
      |           |
      |           const char*
a.cc:16:15: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   16 |         ans = "WA";
      |               ^~~~
      |               |
      |               const char*
a.cc:22:11: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   22 |     ans = "WA";
      |           ^~~~
      |           |
      |           const char*
Language: C++

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

int main()
{
  string s;
  cin>>s;
  
  bool juge = true;
  
  string first = s.substr(0,1);
  if(first!="A"){
    juge = false;
   }
  
  int cnt=0;
  for(int i=2;i<s.length()-1;i++)
  {
   

    if(s.at(i)=="C"){
      cnt++;
    }
  }
  
  if(cnt !=1)
  {
      juge = false;
  }
  
  for(int i=0;i<s.length();i++)
  {
       string v = s.substr(i,1);
    
      if(v!="A"&&v!="C"&&v>"Z")
      {
          juge = false;
      }
    
  }
  
  
  if(juge)
  {
       cout<<"AC"<<endl;
  }
  else
  {
       cout<<"WA"<<endl;
  }
  
  return 0;
}
  
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:21:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   21 |     if(s.at(i)=="C"){
      |        ~~~~~~~^~~~~
Language: C++

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

int main()
{
  string s;
  cin>>s;
  
  bool juge = true;
  
  string first = s.substr(0,1);
  if(first!="A"){
    juge = false;
   }
  
  int cnt=0;
  for(int i=2;i<s.length()-1;i++)
  {
   

    if(s[i]=="C"){
      cnt++;
    }
  }
  
  if(cnt !=1)
  {
      juge = false;
  }
  
  for(int i=0;i<s.length();i++)
  {
       string v = s.substr(i,1);
    
      if(v!="A"&&v!="C"&&v>"Z")
      {
          juge = false;
      }
    
  }
  
  
  if(juge)
  {
       cout<<"AC"<<endl;
  }
  else
  {
       cout<<"WA"<<endl;
  }
  
  return 0;
}
  
  
  


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

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

int main()
{
  string s;
  cin>>s;
  
  bool juge = true;
  
  string first = s.substr(0,1);
  if(first!="A"){
    juge = false;
   }
  
  int cnt=0;
  for(int i=3;i<s.length-1;i++)
  {
    string x = s.substr(i,1);

    if(x=="C"){
      cnt++;
    }
  }
  
  if(cnt !=1)
  {
      juge = false;
  }
  
  for(int i=0;i<s.length;i++)
  {
       string v = s.substr(i,1);
    
      if(v!="A"&&v!="C"&&v>"Z")
      {
          juge = false;
      }
    
  }
  
  
  if(juge)
  {
       cout<<"AC"<<endl;
  }
  else
  {
       cout<<"WA"<<endl;
  }
  
  return 0;
}
  
  
  

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

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

int main() {
string S; cin>>S;
  int K=0;
  if(S.at(0)=='A')
    K++;
  int G=0;// Cのかず
  for(int i=2; i<S.size()-2; i++){
    if(S.at(i)=='C')
      G++;
  }
  if(G==1&&S.at(0)!='C'&&S.at(1)!='C'&&S.at(S.size())!='C') K++;
  int QA=0;
  for(int i=0; i<S.size()-1;i++){
if(isupper(S.at(i))&&S.at(i)!='A'&&S.at(i)!='C'){
  QA++;
    else continue;
}
  }
  if(QA==0)
    K++;
  if(K==3)
    cout<<"AC"<<endl;
  else cout<<"WA"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: expected '}' before 'else'
   19 |     else continue;
      |     ^~~~
a.cc:17:49: note: to match this '{'
   17 | if(isupper(S.at(i))&&S.at(i)!='A'&&S.at(i)!='C'){
      |                                                 ^
a.cc: At global scope:
a.cc:22:3: error: expected unqualified-id before 'if'
   22 |   if(QA==0)
      |   ^~
a.cc:24:3: error: expected unqualified-id before 'if'
   24 |   if(K==3)
      |   ^~
a.cc:26:3: error: expected unqualified-id before 'else'
   26 |   else cout<<"WA"<<endl;
      |   ^~~~
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
Language: C++

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

int main() {
string S; cin>>S;
  int K=0;
  if(S.at(0)=='A')
    K++;
  int G=0;// Cのかず
  for(int i=2; i<S.size()-2; i++){
    if(S.at(i)=='C')
      G++;
  }
  if(G==1&&S.at(0)!='C'&&S.at(1)!='C'&&S.at(S.size())!='C') K++;
  int QA=0;
  for(int i=0; i<S.size()-1;i++){
if(isupper(S.at(i))&&S.at(i)!='A'&&S.at(i)!='C'){
  QA++;
    else continue;
  }
  if(QA==0)
    K++;
  if(K==3)
    cout<<"AC"<<endl;
  else cout<<"WA"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: expected '}' before 'else'
   19 |     else continue;
      |     ^~~~
a.cc:17:49: note: to match this '{'
   17 | if(isupper(S.at(i))&&S.at(i)!='A'&&S.at(i)!='C'){
      |                                                 ^
Language: C++

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

int main() {
string S; cin>>S;
  int K=0;
  if(S.at(0)=='A')
    K++;
  int G=0;// Cのかず
  for(int i=2; i<S.size()-2; i++){
    if(S.at(i)=='C')
      G++;
  }
  if(G==1&&S.at(0)!='C'&&S.at(1)!='C'&&S.at(S.size())!='C') K++;
  int QA=0;
  for(int i=0; i<S.size()-1;i++){
if(isupper(S.at(i)&&S.at(i)!='A'&&S.at(i)!='C'){
  QA++;
    else continue;
  }
  if(QA==0)
    K++;
  if(K==3)
    cout<<"AC"<<endl;
  else cout<<"WA"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:48: error: expected ';' before '{' token
   17 | if(isupper(S.at(i)&&S.at(i)!='A'&&S.at(i)!='C'){
      |                                                ^
      |                                                ;
a.cc:21:3: error: expected primary-expression before 'if'
   21 |   if(QA==0)
      |   ^~
a.cc:20:4: error: expected ')' before 'if'
   20 |   }
      |    ^
      |    )
   21 |   if(QA==0)
      |   ~~
a.cc:17:3: note: to match this '('
   17 | if(isupper(S.at(i)&&S.at(i)!='A'&&S.at(i)!='C'){
      |   ^
a.cc:26:2: error: expected '}' at end of input
   26 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

int main(){
  int nu=0,ma=0;
  string s;
  cin>>s;
  for(int i=0;i<size();i++){
    if(s[i]>='A'&&s[i]<='Z'){
      ma++;
    }
  }
  for(int i=2;i<=s.size()-3;i++){
    if(s[i]=='C'){
      nu++;
    }
  }
  if(s[0]=='A'&&nu==1&&ma==2){
    cout<<"AC"<<endl;
  }
  else{
    cout<<"WA"<<endl;
  }
}
    
  
  



Compiler output:
a.cc: In function 'int main()':
a.cc:8:21: error: no matching function for call to 'size()'
    8 |   for(int i=0;i<size();i++){
      |                 ~~~~^~
In file included from /usr/include/c++/14/string:53,
                 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/range_access.h:262:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:272:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note:   candidate expects 1 argument, 0 provided
Language: C

#include<stdio.h>

int main(void){
        char s[10], c;
        int l = 0, i, cnt = 0, ok = true;;
        while((c=getchar())!='\n') s[l++] = c;
        for(i=0; i<l; i++){
                if('a'<=s[i] && s[i]<='z') cnt++;
                else if(s[i]=='C'){
                        if(1<i && i<l-1) ok = true;
                        else ok = false;
                }
                else if(s[i]=='A'){
                        if(i==0) ok = true;
                        else ok = false;
                }
                else ok = false;
        }
        if(ok && cnt==l-2) puts("AC");
        else puts("WA");
        return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:37: error: 'true' undeclared (first use in this function)
    5 |         int l = 0, i, cnt = 0, ok = true;;
      |                                     ^~~~
main.c:2:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include<stdio.h>
  +++ |+#include <stdbool.h>
    2 | 
main.c:5:37: note: each undeclared identifier is reported only once for each function it appears in
    5 |         int l = 0, i, cnt = 0, ok = true;;
      |                                     ^~~~
main.c:11:35: error: 'false' undeclared (first use in this function)
   11 |                         else ok = false;
      |                                   ^~~~~
main.c:11:35: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C

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

int main()
{
	char S[11];
	scanf("%s", S);
	
	int i, l, flag = 1, count = 0, mark[11] = {1};
	for (l = 0; S[l] != 0; l++);
	if (S[0] != 'A') flag = 0;
	for (i = 2; i <= l - 2; i++) {
		if (A[i] == 'C') {
			count++;
			mark[i] = 1;
		}
	}
	if (count != 1) flag = 0;
	for (i = 0; i < l; i++) {
		if (mark[i] == 0 && (S[i] < 'a' || S[i] > 'z')) flag = 0;
	}
	
	if (flag == 1) printf("AC\n");
	else printf("WA\n");
	fflush(stdout);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:21: error: 'A' undeclared (first use in this function)
   13 |                 if (A[i] == 'C') {
      |                     ^
main.c:13:21: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define COUT(x) cout<<(x)<<endl
#define dump(x)  cout << #x << " = " << (x) << endl;
using ll = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;
using M = map<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int, vector<int>, greater<int>>;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

int main() {
  string s; cin >> s;
  bool ok = true;

  if (s[0] != 'A') ok = false;
  int cnt=0;
  for (int i = 2; i < s.size()-1; i++) if (c == 'C') cnt++;
  if (cnt != 1) ok = false;
  for (char c: s) {
    if (c=='A' || c == 'C') continue;
    if (isupper(c)) ok = false;
  }
  COUT(ok?"AC":"WA");
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:44: error: 'c' was not declared in this scope
   22 |   for (int i = 2; i < s.size()-1; i++) if (c == 'C') cnt++;
      |                                            ^
Language: C++

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

int main() {
  string S;
  cin>>S;
  int A=0;
  if(S.at(0)!='A'){
    A+=2;
  }
  for(int i=2;i<S.size()-1;i++){
    if(S.at(i)=='C'){
      A++;
    }
  }
  if(A==2){
    cout<<"AC"<<endl;
  }
  elae{
    cout<<"WA"<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:3: error: 'elae' was not declared in this scope
   19 |   elae{
      |   ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
vector<int> input(int n) {
    vector<int> vec(n);
    for (int i = 0; i < n; i++) {
        cin >> vec.at(i);
    }
    return vec;
}
void output(vector<int> vec) {
    for (int i = 0; i < vec.size(); i++) {
        cout << vec[i] << " ";
    }
    return;
}
vector<int> sort(vector<int> vec) {
    sort(vec.begin(), vec.end());
    return vec;
}
vector<int> resort(vector<int> vec) {
    sort(vec);
    reverse(vec.begin(), vec.end());
    return vec;
}
vector<vector<int>> input(int n, int m) {
    vector<vector<int>> table(n, vector<int>(m));
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            cin >> table. at(i).at(j);
        }
    }
    return table;
}
void output(vector<vector<int>> table) {
    for (int i = 0; i < table.size(); i++) {
        for (int j = 0; j < table.at(0).size(); j++) {
            cout << table.at(i).at(j) << " ";
        }
        cout << endl;
    }
}
long long perm(int n, int r) {
    if (n < r) {
        cout << "error" << endl;
        return 0;
    }
    long long perm = 1;
    for (int i = n; i > n - r; i--) {
        perm *= i;
    }
    return perm;
}
long long comb(int n, int r) {
    if (n < r) {
        cout << "error" << endl;
        return 0;
    }
    long long comb = perm(n,r);
    for (int i = r; i > 0; i--) {
        comb /= i;
    }
    return comb;
}
long long homo(int n, int r) {
    return comb(n + r - 1, n - 1);
}
long long fact(int n) {
    long long fact = 1;
    for (int i = n; i > 0; i--) {
        fact *= i;
    }
    return fact;
}
int gcd(int a, int b){
    if (a % b == 0){
      return(b);
    }else{
      return(gcd(b, a % b));
    }
}
int lcm(int a, int b) {
    return a * b / gcd(a, b);
}
int main() {
  string s;
    cin >> s;
    bool flag = true;
    if (s[0] != 'A') {
        flag = false;
    }
    string t = substr(2, s.size() - 3);
    sort(t.begin(),t.end());
    if (t[0] != 'C') {
        flag = false;
    }
    int cnt = 0;
    for (int i = 0; i < s.size(); i++) {
        if (islower(s[i])) {
            cnt++;
        }
    }
    if (cnt != s.size() - 2) {
        flag = false;
    }
    if (flag) {
        cout << "AC" << endl;
    }
    else {
        cout << "WA" << endl;
    }
}

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

#include<iostream>
#include<string>
#include<vector>
using namespace std;
int main(){
 string s;
  cin>>s;
  int a=s.size(),ans1=0,ans2=0,ans3=0;
  for(int i=2;i<=a-1;i++){
if(s[i]=='C') ans1=1;
  }
  if(s[0]=='A') ans2=1;
  for(int i=0;i<a;i++){
    if(s[i]!='A'&&s[i]!='C'&&s[i]>='B'&&a[i]<='Z') ans3=1;
  }
  if(ans1==1&&ans2==1&&ans3==0) cout<<"AC"<<endl;
  else cout<<"WA"<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:42: error: invalid types 'int[int]' for array subscript
   14 |     if(s[i]!='A'&&s[i]!='C'&&s[i]>='B'&&a[i]<='Z') ans3=1;
      |                                          ^
Language: C++

/** author: __nishad__ **/

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


typedef long long ll ;
typedef vector<ll> vll ;

#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define all(v) (v).begin(),(v).end()
#define precision(k) cout<<setprecision(k)<<fixed;
#define loop(i,a) for(int i=0; i<a;i++)
#define loop2(i,a,b) for(int i=(a);i<=(b);++i)
#define minv(v) *min_element(all(v))
#define maxv(v) *max_element(all(v))
#define getpos(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define unq(v) sort(all(v)),(v).erase(unique((v).begin(),(v).end()),(v).end())
#define pb push_back
#define pi 3.14159265358979323
#define endl "\n"

int main()
{
    IOS;

    string s;
    cin>>s;
    int n = s.size(), i;
    bool ans = true;

    string str1 = s.substr(2,s.size()-3);
    int c = count(str1.begin(), str1.end(), 'C');

    if(s[0] == 'A'){
        if(c == 1){
            for(i=0; i<n; i++){
                if(s[i] == 'A' || s[i] == 'C'){
                    if(i <3 && i<str.size()-1)
                        continue;
                    else ans = false;
                }
                else if(s[i] < 'a' && s[i] > 'z')
                    ans =false;
            }
        }
        else ans = false;
    }
    else ans = false;

    cout<<(ans? "AC" : "WA");

}



Compiler output:
a.cc: In function 'int main()':
a.cc:39:34: error: 'str' was not declared in this scope; did you mean 'str1'?
   39 |                     if(i <3 && i<str.size()-1)
      |                                  ^~~
      |                                  str1
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<ll>;
using vii = vector<vi>;
using Pll = pair<ll, ll>;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int) x.size())
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
const int MOD = 1000000007;
template<class T> void print(const T& t){ cout << t << endl; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main(){
  string s;
  cin >> s;
  bool ans = true;
  if(s[0]!='A'){
    ans = false;
  }
  ll count_C = 0;
  for (ll i = 2; i <= sz(s) - 2;i++){
    if(s[i]=='C'){
      count_C++;
    }
  }
  if(count_C!=1){
    ans = false;
  }
  ll count = 0;
  rep(i, sz(s)){
    if(s[i]>='A'&&s[i]<='Z'){
      count++;
    }
  }
  if(count!=2){
    ans = false;
  }
  if(ans){
    print("AC");
  }
  else{
    print("WA");
  }

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

#include <iostream>
#include <string>

using namespace std;

int main(int argc, char const *argv[])
{
    string S;
    cin >> S;
    int cnt = 0;
    if (S[0] == 'A')
    {
        if (!(('a' <= S[i] && S[i] <= 'z') || S[1] == 'C'))
        {
            cout << "WA" << endl;
            return 0;
        }

        for (int i = 2; i <= S.length() - 2; i++)
        {
            if (!(('a' <= S[i] && S[i] <= 'z') || S[i] == 'C'))
            {
                cout << "WA" << endl;
                return 0;
            }
            if (S[i] == 'C') cnt++;
            
        }

        if (cnt == 1)
        {
            cout << "AC" << endl;
        }else
        {
            cout << "WA" << endl;
        }
        
    }else
    {
        cout << "WA" << endl;
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:13:25: error: 'i' was not declared in this scope
   13 |         if (!(('a' <= S[i] && S[i] <= 'z') || S[1] == 'C'))
      |                         ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(int argc, char const *argv[])
{
    string S;
    cin >> S;
    int cnt = 0;
    if (S[0] == 'A')
    {
        if (!(('a' <= S[i] && S[i] <= 'z') || S[i] == 'C'))
        {
            cout << "WA" << endl;
            return 0;
        }

        for (int i = 2; i <= S.length() - 2; i++)
        {
            if (!(('a' <= S[i] && S[i] <= 'z') || S[i] == 'C'))
            {
                cout << "WA" << endl;
                return 0;
            }
            if (S[i] == 'C') cnt++;
            
        }

        if (cnt == 1)
        {
            cout << "AC" << endl;
        }else
        {
            cout << "WA" << endl;
        }
        
    }else
    {
        cout << "WA" << endl;
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:13:25: error: 'i' was not declared in this scope
   13 |         if (!(('a' <= S[i] && S[i] <= 'z') || S[i] == 'C'))
      |                         ^
Language: C

#include <stdio.h>
#include <string.h>
int main(void){
  char s[10];
  int l,f,i,a,b;
  scanf("%s",s);
  l=strlen(s);
  f=0;
  if(s[0]=='A')f++;
  a=0;
  if(i=3;i<l-1;i++)
    if(s[i]=='c')a++;
  if(a==1)f++;
  for(i=0;i<l;i++){
    if(((s[i]>='a')&&(s[i]<='z'))||(s[i]=='A')||(s[i]=='C')) b++;
  }
  if(b==l)f++;
  if(b==3)printf("AC");
  else printf("WA");
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:9: error: expected ')' before ';' token
   11 |   if(i=3;i<l-1;i++)
      |     ~   ^
      |         )
Language: C

#include <stdio.h>
#include <string.h>
int main(void){
  char s[10];
  int l,f,i,a,b;
  scanf("%s",s);
  l=strlen(s);
  f=0;
  if(s[0]=='A')f++;
  a=0;
  if(i=3;i<l-1;i++)
    if(s[i]=='c')a++;
  if(a==1)f++;
  for(i=0;i<l;i++){
    if(((s[i]>='a')&&(s[i]<='z'))||(s[i]=='A')||(s[i]=='C')) b++;
  }
  if(b==L)f++;
  if(b==3)printf("AC");
  else printf("WA");
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:9: error: expected ')' before ';' token
   11 |   if(i=3;i<l-1;i++)
      |     ~   ^
      |         )
main.c:17:9: error: 'L' undeclared (first use in this function)
   17 |   if(b==L)f++;
      |         ^
main.c:17:9: note: each undeclared identifier is reported only once for each function it appears in