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

#include<bits/stdc++.h>
using namespace std;
int main(){
  string S;
  cin>>S;
  int N=S.size();
  bool flag=true;
  if(S.at(0)!='A'){
    flag=false;
  }
  if(S.at(1)=='C'||S.at(N-1)=='C'){
    flag=false;
  }
  if(islower(S.at(1))==0||islower(S.at(N-1))==0){
    flag=false;
  }
  int count=0;
  for(int i=2;i<N-1){
    if(S.at(i)=='C'){
      count=count+1;
    }
    else{
      if(islower(S.at(i))==0){
        flag=false;
      }
    }
  }
  if(flag==true&&count==1){
    cout<<"AC"<<endl;
  }
  else{
    cout<<"WA"<<endl;
  }
}
      
    


Compiler output:
a.cc: In function 'int main()':
a.cc:18:20: error: expected ';' before ')' token
   18 |   for(int i=2;i<N-1){
      |                    ^
      |                    ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string S;
  cin>>S;
  int N=S.size();
  bool flag==true;
  if(S.at(0)!='A'){
    flag=false;
  }
  if(S.at(1)=='C'||S.at(N-1)=='C'){
    flag=false;
  }
  if(islower(S.at(1))==0||islower(S.at(N-1))==0){
    flag=false;
  }
  int count=0;
  for(int i=2;i<N-1){
    if(S.at(i)=='C'){
      count=count+1;
    }
    else{
      if(islower(S.at(i))==0){
        flag=false;
      }
    }
  }
  if(flag==true&&count==1){
    cout<<"AC"<<endl;
  }
  else{
    cout<<"WA"<<endl;
  }
}
      
    

Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: expected initializer before '==' token
    7 |   bool flag==true;
      |            ^~
a.cc:9:5: error: 'flag' was not declared in this scope
    9 |     flag=false;
      |     ^~~~
a.cc:12:5: error: 'flag' was not declared in this scope
   12 |     flag=false;
      |     ^~~~
a.cc:15:5: error: 'flag' was not declared in this scope
   15 |     flag=false;
      |     ^~~~
a.cc:18:20: error: expected ';' before ')' token
   18 |   for(int i=2;i<N-1){
      |                    ^
      |                    ;
a.cc:24:9: error: 'flag' was not declared in this scope
   24 |         flag=false;
      |         ^~~~
a.cc:28:6: error: 'flag' was not declared in this scope
   28 |   if(flag==true&&count==1){
      |      ^~~~
Language: C++

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

int main(){
  string S;
  cin >> S;
  int L = S.size();
  string ans = "AC";
  if(S[0] != 'A'){
    ans = "WA";
  }

  //2文字目以降を見る
  for(int i = 1; i < L; ++i){
    int cnt = 0;//先頭から3文字目と末尾から2文字目の間（両端含む）の'C'の個数
    if(isupper(S[i])){//isupper()は、文字が英大文字かどうか判定する
      if(i == 1 || i == L - 1 || S[i] != 'C'){//2番目or最後or2番目から最後までに'C'が入ってない
        ans = "WA";
      }
      ++cnt;
    }
  }
  if(cnt != 1){
     ans = "WA";
  }
    cout << ans << endl;
}
//PDFの解答

Compiler output:
a.cc: In function 'int main()':
a.cc:23:6: error: 'cnt' was not declared in this scope; did you mean 'int'?
   23 |   if(cnt != 1){
      |      ^~~
      |      int
Language: C++

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

int main(){
  string s;
  cin >> s;
  //関数を作っちゃう
  if (check(string s)){
    cout << "AC" << endl;
  }
  else {
    cout << "WA" << endl;
  }
  return 0;
}
  //おかしいの見つけたら即座にfalseを返して最後のcheckまで耐えられたら0を返す
bool check(string s){
    if(s[0]!='A') return false;
    int c=0;
    for (int i=2;i<s.length()-1;++i){
      if (s[i]=='C') c++;
    }
    if (c!=1) return false;
    
    int upper=0;
    for (int i=0;i<s.length();++i){
      if (s[i]>='A'&&s[i]<='Z'){
        upper++;
      }
    }
    if (upper!=2) return false;
    return true;
}
    


Compiler output:
a.cc: In function 'int main()':
a.cc:8:20: error: expected primary-expression before 's'
    8 |   if (check(string s)){
      |                    ^
a.cc:8:7: error: 'check' was not declared in this scope
    8 |   if (check(string s)){
      |       ^~~~~
Language: C++

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

int main(){
  string s;
  cin >> s;
    //おかしいの見つけたら即座にfalseを返して最後のcheckまで耐えられたら0を返す
bool check(string s){
    if(s[0]!='A') return false;
    int c=0;
    for (int i=2;i<s.length()-1;++i){
      if (s[i]=='C') c++;
    }
    if (c!=1) return false;
    
    int upper=0;
    for (int i=0;i<s.length();++i){
      if (s[i]>='A'&&s[i]<='Z'){
        upper++;
      }
    }
    if (upper!=2) return false;
    return true;
  //関数を作っちゃう
  if (check(s)){
    cout << "AC" << endl;
  }
  else {
    cout << "WA" << endl;
  }
  return 0;
}

    


Compiler output:
a.cc: In function 'int main()':
a.cc:8:21: error: a function-definition is not allowed here before '{' token
    8 | bool check(string s){
      |                     ^
a.cc:32:2: error: expected '}' at end of input
   32 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

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

int main(){
  string s;
  cin >> s;
  //関数を作っちゃう
  if (check(s)){
    cout << "AC" << endl;
  }
  else {
    cout << "WA" << endl;
  }
  return 0;
}
  //おかしいの見つけたら即座にfalseを返して最後のcheckまで耐えられたら0を返す
bool check(string s){
    if(s[0]!='A') return false;
    int c=0;
    for (int i=2;i<s.length()-1;++i){
      if (s[i]=='C') c++;
    }
    if (c!=1) return false;
    
    int upper=0;
    for (int i=0;i<s.length();++i){
      if (s[i]>='A'&&s[i]<='Z'){
        upper++;
      }
    }
    if (upper!=2) return false;
    return true;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'check' was not declared in this scope
    8 |   if (check(s)){
      |       ^~~~~
Language: C++

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

int main(){
  string s;
  cin >> s;
  
  if (s[0]=='A'-'0'){
    for (int i=2;i<s.length()-2;++i){
      if (s[i]=='C'-'0');
//のりちんの限界

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

#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin >> s;
  string t="AC";
  int i,count=0,count_2=0;
  if(s.at(0)!='A'){
    t="WA";
  }
  for(i=1;i<s.size();i++){
    if(s.at(i)<='z' && s.at(i)>='a'){
      count++;
    }
  }
  for(i=2;i<s.size()-1;i++){
    if(s.at(i)='C'){
      count_2++;
    }
  }
  if(count!=s.size()-2 && count_2!=1){
    t="WA;
  }
  cout << t;
}
    
    
  

Compiler output:
a.cc:22:7: warning: missing terminating " character
   22 |     t="WA;
      |       ^
a.cc:22:7: error: missing terminating " character
   22 |     t="WA;
      |       ^~~~
a.cc: In function 'int main()':
a.cc:23:3: error: expected primary-expression before '}' token
   23 |   }
      |   ^
Language: C++

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

int main(){
  string S;
  int ccnt=0;
  bool b = 1;
  cin >> S;
  if(S.at(i)!='A'){
    b = 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'){
        b = 0;
      }
      ++ccnt;
    }
  }
  if(ccnt!=1){
    b = 0;
  }
  if(b){
    cout << "AC" << endl;
  }else{
    cout << "WA" << endl;
  }
}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
string S;
  cin>>S;
  int N=S.size();
  bool ans=true;
  int sum=0;
  if(S.at(0)=='A'){
  for(int i=2;i<N-2;i++){
  if(S.at(i)=='C'){
  sum++; if(sum==2){ans=false;break;}
  }else{
  if(!('a'<=S.at(i) && S.at(i)<='z'){
     ans=false; break;}
  }
  }
  
  }else{
  ans=false;
  }if(sum==0) ans=false;
     if(ans)
     cout<<"AC"<<endl;
     else
     cout<<"WA"<<endl;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:14:37: error: expected ')' before '{' token
   14 |   if(!('a'<=S.at(i) && S.at(i)<='z'){
      |     ~                               ^
      |                                     )
a.cc:16:3: error: expected primary-expression before '}' token
   16 |   }
      |   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
string S;
  cin>>S;
  int N=S.size();
  bool ans=true;
  int sum=0;
  if(S.at(0)=='A'){
  for(int i=2;i<N-2;i++){
  if(S.at(i)=='C'){
  sum++; if(sum==2){ans=false;break;}
  }else{
  if(!('a'<=S.at(i) && S.at(i)<='z')
     ans=false; break;
  }
  }
  
  }else{
  ans=false;
  }if(sum==0) ans=false;
     if(ans)
     cout<<"AC"<<endl;
     else
     cout<<"WA"<<endl;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:14:37: error: expected ';' before 'ans'
   14 |   if(!('a'<=S.at(i) && S.at(i)<='z')
      |                                     ^
      |                                     ;
   15 |      ans=false; break;
      |      ~~~                             
a.cc:15:17: error: expected primary-expression before 'break'
   15 |      ans=false; break;
      |                 ^~~~~
a.cc:15:16: error: expected ')' before 'break'
   15 |      ans=false; break;
      |                ^~~~~~
      |                )
a.cc:14:5: note: to match this '('
   14 |   if(!('a'<=S.at(i) && S.at(i)<='z')
      |     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
string S;
  cin>>S;
  int N=S.size();
  bool ans=true;
  int sum=0;
  if(S.at(0)=='A'){
  for(int i=2;i<N-2;i++){
  if(A.at(i)=='C'){
  sum++; if(sum==2){ans=false;break;}
  }else{
  if(!('a'<=A.at(i) && A.at(i)<='z')
     ans=false; break;
  }
  }
  
  }else{
  ans=false;
  }if(sum==0) ans=false;
     if(ans)
     cout<<"AC"<<endl;
     else
     cout<<"WA"<<endl;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:11:6: error: 'A' was not declared in this scope
   11 |   if(A.at(i)=='C'){
      |      ^
a.cc:15:17: error: expected primary-expression before 'break'
   15 |      ans=false; break;
      |                 ^~~~~
a.cc:15:16: error: expected ')' before 'break'
   15 |      ans=false; break;
      |                ^~~~~~
      |                )
a.cc:14:5: note: to match this '('
   14 |   if(!('a'<=A.at(i) && A.at(i)<='z')
      |     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
string S;
  cin>>S;
  int N=S.size();
  bool ans=true;
  int sum=0;
  if(S.at(0)=='A'){
  for(int 2;i<N-2;i++){
  if(A.at(i)=='C'){
  sum++; if(sum=2){ans=false;break;}
  }else{
  if(!('a'<=A.at(i) && A.at(i)<='z')
     ans=false; break;
  }
  }
  
  }else{
  ans=false;
  }if(sum==0) ans=false;
     if(ans)
     cout<<"AC"<<endl;
     else
     cout<<"WA"<<endl;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: expected unqualified-id before numeric constant
   10 |   for(int 2;i<N-2;i++){
      |           ^
a.cc:10:10: error: expected ';' before numeric constant
   10 |   for(int 2;i<N-2;i++){
      |          ^~
      |          ;
a.cc:10:13: error: 'i' was not declared in this scope
   10 |   for(int 2;i<N-2;i++){
      |             ^
a.cc:10:18: error: expected ')' before ';' token
   10 |   for(int 2;i<N-2;i++){
      |      ~           ^
      |                  )
a.cc:10:19: error: 'i' was not declared in this scope
   10 |   for(int 2;i<N-2;i++){
      |                   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
string S;
  cin>>S;
  int N=S.size();
  bool ans=true;
  int sum=0;
  if(S.at(0)=='A'){
  for(int 2;i<N-2;i++){
  if(A.at(i)=='C'){
  sum++; if(sum=2){ans=false;break;}
  }else{
  if(!('a'<=A.at(i) && A.at(i)<='z')
     ans=false; break;
  }
  }
  
  }else{
  ans=false;
  }if(sum==0) ans=false;
     if(ans)
     cout<<"AC"<<endl;
     else
     cout<<"WA"<<enl;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: expected unqualified-id before numeric constant
   10 |   for(int 2;i<N-2;i++){
      |           ^
a.cc:10:10: error: expected ';' before numeric constant
   10 |   for(int 2;i<N-2;i++){
      |          ^~
      |          ;
a.cc:10:13: error: 'i' was not declared in this scope
   10 |   for(int 2;i<N-2;i++){
      |             ^
a.cc:10:18: error: expected ')' before ';' token
   10 |   for(int 2;i<N-2;i++){
      |      ~           ^
      |                  )
a.cc:10:19: error: 'i' was not declared in this scope
   10 |   for(int 2;i<N-2;i++){
      |                   ^
a.cc:25:18: error: 'enl' was not declared in this scope; did you mean 'ynl'?
   25 |      cout<<"WA"<<enl;
      |                  ^~~
      |                  ynl
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
string S;
  cin>>S;
  int N=S.size();
  bool ans=true;
  int sum=0;
  if(S.at(0)=='A'){
  for(int 2;i<N-2;i++){
  if(A.at(i)=='C'){
  sum++; if(sum=2){ans=false;break;}
  }else{
  if(!('a'<=A.at(i) && A.at(i)<='z')
     ans=false; break;
  }
  }
  
  }else{
  ans=false;
  }if(sum==0) ans=false;
     if(ans)
     cout<<"AC"<<endl;
     else
     cout<<"WA<<enl;
  return 0;
}



Compiler output:
a.cc:25:12: warning: missing terminating " character
   25 |      cout<<"WA<<enl;
      |            ^
a.cc:25:12: error: missing terminating " character
   25 |      cout<<"WA<<enl;
      |            ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:10:11: error: expected unqualified-id before numeric constant
   10 |   for(int 2;i<N-2;i++){
      |           ^
a.cc:10:10: error: expected ';' before numeric constant
   10 |   for(int 2;i<N-2;i++){
      |          ^~
      |          ;
a.cc:10:13: error: 'i' was not declared in this scope
   10 |   for(int 2;i<N-2;i++){
      |             ^
a.cc:10:18: error: expected ')' before ';' token
   10 |   for(int 2;i<N-2;i++){
      |      ~           ^
      |                  )
a.cc:10:19: error: 'i' was not declared in this scope
   10 |   for(int 2;i<N-2;i++){
      |                   ^
a.cc:26:3: error: expected primary-expression before 'return'
   26 |   return 0;
      |   ^~~~~~
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef tuple<int,int,int> T;
typedef vector<P> vp;
typedef vector<T> vt;

int main(void){
  string s;
  cin >> s;
  if(check(s)){
    cout << "AC" << endl;
  } else {
    cout << "WA" << endl;
  }
  return 0;

  bool check(string s){
    if(s[0]!='A') return false;
    int C=0;
    for(int i=2; i<s.length()-1; i++){
      if(s[i]=='C'){
        C++;
      }
    }
    if(C!=1) return false;

  int upper=0;
  for(int i=0; i<s.length(); i++){
    if(s[i]>='A'&&s[i]<='Z'){
      upper++;
    }
  }
  if(upper !=2) return false;
  return true;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:6: error: 'check' was not declared in this scope
   16 |   if(check(s)){
      |      ^~~~~
a.cc:23:23: error: a function-definition is not allowed here before '{' token
   23 |   bool check(string s){
      |                       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void){
    string S;
    cin >> S;
    if(S[0] != 'A'){
        cout << "WA" << endl;
        return 0;
    }
    bool flag = false;
    int k = -1;
    for(int i = 2; i < S.size()-1; i++){
        else if(flag == true && S[i] == 'C'){
            cout << "WA" << endl;
            return 0;
        }
        if(S[i] == 'C'){
            flag = true;
            k = i;
        }
    }
    for(int i = 1; i < S.size(); i++){
        if(isupper(S[i])){
            if(i != k){
                cout << "WA" << endl;
                return 0;
            }
        }
    }
    if(flag == false) cout << "WA" << endl;
    else cout << "AC" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'else' without a previous 'if'
   13 |         else if(flag == true && S[i] == 'C'){
      |         ^~~~
Language: C++

s = input()
if s[0]=="A" and s[2:-1].count("C")==1 and s.replace("A","").replace("C","").islower():
    print("AC")
else:
    print("WA")

Compiler output:
a.cc:1:1: error: 's' does not name a type
    1 | s = input()
      | ^
Language: C++

s = input()
if s[0]==s[0].upper()and s[2]==s[2].upper() and s[3:-1]==s[3:-1].lower()and s[1]==s[1].lower()and s[-1]==s[-1].lower():
    print("AC")
else:
    print("WA")



Compiler output:
a.cc:1:1: error: 's' does not name a type
    1 | s = input()
      | ^
Language: C++

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


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

  if(sum == 0 || sum >= 2){ cout << "WA" << endl; return 0; }
  
  sum = 0;
  for(int i = 0; i < S.size(); i++){
    if(isupper(S[i])){ sum++; }
  }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: expected ';' before '{' token
    8 |   if(S[0] != 'A'{ cout << "WA" << endl; return 0; }
      |                 ^
      |                 ;
a.cc:9:14: error: expected ')' before ';' token
    9 |   int sum = 0;
      |              ^
      |              )
a.cc:8:5: note: to match this '('
    8 |   if(S[0] != 'A'{ cout << "WA" << endl; return 0; }
      |     ^
a.cc:11:22: error: 'sum' was not declared in this scope
   11 |     if(S[i] == 'C'){ sum++; }
      |                      ^~~
a.cc:14:6: error: 'sum' was not declared in this scope
   14 |   if(sum == 0 || sum >= 2){ cout << "WA" << endl; return 0; }
      |      ^~~
a.cc:16:3: error: 'sum' was not declared in this scope
   16 |   sum = 0;
      |   ^~~
Language: C++

//解説版
#include <iostream>
#include <bits/stdc++.h>
#include <string>
#include <math.h>
#include <vector>
using namespace std;
int main(){
    string s; cin>>s;
    int l=s.size();
    string ans="AC";
    if(s[0]!='A') ans='WA';
    int cnt=0;
    for(int 1;i<l;i++){
        if(isupper(s[i])){
            //大文字が条件以外にあるときとCでないときを排除
            if(i==1||i==l-1||s[i]!='C') ans='WA';
            cnt++;
        }
    }
    //大文字二つ以上の条件にすることでCが二つ以上あるときを排除
    if(cnt!=1) ans="WA";
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc:12:23: warning: multi-character character constant [-Wmultichar]
   12 |     if(s[0]!='A') ans='WA';
      |                       ^~~~
a.cc:17:45: warning: multi-character character constant [-Wmultichar]
   17 |             if(i==1||i==l-1||s[i]!='C') ans='WA';
      |                                             ^~~~
a.cc: In function 'int main()':
a.cc:12:23: warning: overflow in conversion from 'int' to 'char' changes value from '22337' to '65' [-Woverflow]
   12 |     if(s[0]!='A') ans='WA';
      |                       ^~~~
a.cc:14:13: error: expected unqualified-id before numeric constant
   14 |     for(int 1;i<l;i++){
      |             ^
a.cc:14:12: error: expected ';' before numeric constant
   14 |     for(int 1;i<l;i++){
      |            ^~
      |            ;
a.cc:14:15: error: 'i' was not declared in this scope
   14 |     for(int 1;i<l;i++){
      |               ^
a.cc:14:18: error: expected ')' before ';' token
   14 |     for(int 1;i<l;i++){
      |        ~         ^
      |                  )
a.cc:14:19: error: 'i' was not declared in this scope
   14 |     for(int 1;i<l;i++){
      |                   ^
Language: C++

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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define eb emplace_back

typedef long long ll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int, int> pii;

void Main(){
	string s;
	cin >> s;
	bool ok = true;

	if(s[0] != "A") ok = false;

	int cnt = 0;
	rep3(i,2,s.size()-2) {
		if(s[i]-'A' >= 0 && 'Z'-s[i] >= 0 && s[i] != 'C') ok = false; 
		if(s[i] == "C") cnt++;
	}
	if(cnt != 1) ok = false;
	  
	if(ok) puts("AC");
	else puts("WA");
	return;
}

int main(){
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
	return 0;
}


Compiler output:
a.cc: In function 'void Main()':
a.cc:25:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   25 |         if(s[0] != "A") ok = false;
a.cc:30:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   30 |                 if(s[i] == "C") cnt++;
Language: C++

#include <iostream>
#include  <algorithm>
#include <string>
#incude  <vector>
using namespace atd;
 int main()
{
string s;cin>>s;
int c=0,a=0;

for(int i=2;i<s.size()-1;i++){
if (s[i]=='C'){c++;}
}
for(int i=1;i<s.size();i++){
if (s[i]=='C'){c++;}
else if (islower (s[i])){a++;}
}
if (c==2&&s[0]=='A'&&a==s.size()-2){cout<<"AC";}
else{cout<<"WA";}
return 0;
}


Compiler output:
a.cc:4:2: error: invalid preprocessing directive #incude; did you mean #include?
    4 | #incude  <vector>
      |  ^~~~~~
      |  include
a.cc:5:17: error: 'atd' is not a namespace-name
    5 | using namespace atd;
      |                 ^~~
a.cc: In function 'int main()':
a.cc:8:1: error: 'string' was not declared in this scope
    8 | string s;cin>>s;
      | ^~~~~~
a.cc:8:1: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:8:10: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 | string s;cin>>s;
      |          ^~~
      |          std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:8:15: error: 's' was not declared in this scope
    8 | string s;cin>>s;
      |               ^
a.cc:18:37: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   18 | if (c==2&&s[0]=='A'&&a==s.size()-2){cout<<"AC";}
      |                                     ^~~~
      |                                     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:19:6: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   19 | else{cout<<"WA";}
      |      ^~~~
      |      std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <iostream>
#include  <algorithm>
#include <string>
#incude  <vector>
 int main()
{
string s;cin>>s;
int c=0,a=0;

for(int i=2;i<s.size()-1;i++){
if (s[i]=='C'){c++;}
}
for(int i=1;i<s.size();i++){
if (s[i]=='C'){c++;}
else if (islower (s[i])){a++;}
}
if (c==2&&s[0]=='A'&&a==s.size()-2){cout<<"AC";}
else{cout<<"WA";}
return 0;
}

Compiler output:
a.cc:4:2: error: invalid preprocessing directive #incude; did you mean #include?
    4 | #incude  <vector>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:7:1: error: 'string' was not declared in this scope
    7 | string s;cin>>s;
      | ^~~~~~
a.cc:7:1: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:7:10: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 | string s;cin>>s;
      |          ^~~
      |          std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:15: error: 's' was not declared in this scope
    7 | string s;cin>>s;
      |               ^
a.cc:17:37: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   17 | if (c==2&&s[0]=='A'&&a==s.size()-2){cout<<"AC";}
      |                                     ^~~~
      |                                     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:18:6: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   18 | else{cout<<"WA";}
      |      ^~~~
      |      std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <iostream>
#include  <algorithm>
#include <string>
#incude  <vector>
 int main()
{
string s;cin>>s;
int c=0,a=0;
if (x[o]=='A'){
for(int i=2;i<s.size()-1;i++){
if (s[i]=='C'){C++;}
else if (islower(s[i])){a++;}
}
}
if (c==2&&a==s.size()-2){cout<<"AC";}
else{cout<<"WA";}
return 0;
}

Compiler output:
a.cc:4:2: error: invalid preprocessing directive #incude; did you mean #include?
    4 | #incude  <vector>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:7:1: error: 'string' was not declared in this scope
    7 | string s;cin>>s;
      | ^~~~~~
a.cc:7:1: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:7:10: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 | string s;cin>>s;
      |          ^~~
      |          std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:15: error: 's' was not declared in this scope
    7 | string s;cin>>s;
      |               ^
a.cc:9:5: error: 'x' was not declared in this scope
    9 | if (x[o]=='A'){
      |     ^
a.cc:9:7: error: 'o' was not declared in this scope
    9 | if (x[o]=='A'){
      |       ^
a.cc:11:16: error: 'C' was not declared in this scope
   11 | if (s[i]=='C'){C++;}
      |                ^
a.cc:15:26: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 | if (c==2&&a==s.size()-2){cout<<"AC";}
      |                          ^~~~
      |                          std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:16:6: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 | else{cout<<"WA";}
      |      ^~~~
      |      std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <iostream>
#include  <algorithm>
#include <string>
#incude  <vector>
 int main()
{
string s;cin>>s;
int c=0,a=0;
if (x[o]=='A'){
for(int i=2;i<s.size()-1;i++){
if (s[i]=='C'){C++;}
else if (islower(s[i])){a++;}
}
if (c==2&&a==s.size()-2){cout<<"AC";}
else{cout<<"WA";}
return 0;
}

Compiler output:
a.cc:4:2: error: invalid preprocessing directive #incude; did you mean #include?
    4 | #incude  <vector>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:7:1: error: 'string' was not declared in this scope
    7 | string s;cin>>s;
      | ^~~~~~
a.cc:7:1: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:7:10: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 | string s;cin>>s;
      |          ^~~
      |          std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:15: error: 's' was not declared in this scope
    7 | string s;cin>>s;
      |               ^
a.cc:9:5: error: 'x' was not declared in this scope
    9 | if (x[o]=='A'){
      |     ^
a.cc:9:7: error: 'o' was not declared in this scope
    9 | if (x[o]=='A'){
      |       ^
a.cc:11:16: error: 'C' was not declared in this scope
   11 | if (s[i]=='C'){C++;}
      |                ^
a.cc:14:26: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 | if (c==2&&a==s.size()-2){cout<<"AC";}
      |                          ^~~~
      |                          std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:15:6: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 | else{cout<<"WA";}
      |      ^~~~
      |      std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:17:2: error: expected '}' at end of input
   17 | }
      |  ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

#include <iostream>
#include <cmath>
#include <vector>
#include<string>
#include <cctype>
using namespace std;
int main(){
string s;
int low =0 ,c =0;
cin >> s;
for (int i =2 ;i<s.length()-1;i++ ){
        if (s[i]  =='C' )c+=1; }
for (int i =1;i<s.length();i++){
    if (islower(s[i] )) low++;   }
if (s[0]=='A' && c=1&& low = s.length()-2  )cout << "AC"<<endl;
else cout << "WA"<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:21: error: lvalue required as left operand of assignment
   15 | if (s[0]=='A' && c=1&& low = s.length()-2  )cout << "AC"<<endl;
      |                    ~^~~~~~
Language: C++

#include <iostream>
#include <cmath>
#include <vector>
#include<string>
#include <cctype>
using namespace std;
int main(){
string s;
int z,l=0 ;
int m=0;
cin >> s;
for (int i =2 ;i<s.length()-1;i++ ){
  if (s[i]  =='C' ){m+=1;   z=i;      }}
for (int i =1;i<s.length();i++){
    if (i =z  )continue;
    if (islower(s[i] )) l++;
    }
if (s[0] == 'A' && m=1 && l=s.length-2 )
  cout << "AC"<<endl;
else
    cout << "WA"<<endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:31: 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 '()' ?)
   18 | if (s[0] == 'A' && m=1 && l=s.length-2 )
      |                             ~~^~~~~~
      |                                     ()
Language: C++

#include <iostream>
#include<string>
#include <cctype>
using namespace std;
int main(){
string s;
int z,l=0 ;
int m=0;
cin >> s;
for (int i =2 ;i<s.length()-1;i++ ){
  if (s[i]  =='C' ){m+=1;   z=i;      }}
for (int i =1;i<s.length();i++){
    if (i =z  )continue;
    if (islower(s[i] )) l++;
    }
if (s[0] == 'A' && m=1 && l=s.length-2 )
  cout << "AC"<<endl;
else
    cout << "WA"<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:31: 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 '()' ?)
   16 | if (s[0] == 'A' && m=1 && l=s.length-2 )
      |                             ~~^~~~~~
      |                                     ()
Language: C++

#include <iostream>
#include<string>
#include <cctype>
using namespace std;
int main(){
string s;
int z ;
int m=0;
cin >> s;
for (int i =2 ;i<s.length()-1;i++ ){
  if (s[i]  =='C' ){m+=1;   z=i;      }}
for (int i =1;i<s.length();i++){
    if (i =z  )continue;
    if (islower(s[i] ));
    }
if (s[0] == 'A' && m=1 )
  cout << "AC"<<endl;
else
    cout << "WA"<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: lvalue required as left operand of assignment
   16 | if (s[0] == 'A' && m=1 )
Language: C++

#include <iostream>
#include<string>
#include <cctype>
using namespace std;
int main(){
string s;
int z ;
int m=0;
cin >> s;
for (int i =2 ;i<s.length()-1;i++ ){
  if (s[i]  =='C' ){m+=1;   z=i;      }}
for (int i =1;i<s.length();i++){
    if (i =z  )continue;
    if (islower(s[i] ));
    }
if (s[0] == 'A' && m=1 )
  cout << "AC"<<endl;
else
    cout << "WA"<<endl;

    return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: lvalue required as left operand of assignment
   16 | if (s[0] == 'A' && m=1 )
a.cc:21:14: error: expected '}' at end of input
   21 |     return 0;
      |              ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

#include <iostream>
#include<string>
#include <cctype>
using namespace std;
int main(){
string s;
int m;
cin >> s;
if (s[0]== 'A' ){
    for (int i =2 ;i<s.length();i++ ){
         if (s[i]  =='C' ){
            m=i;
            break;}   }
    for (int i =1;i<s.length();i++){
        if (i =m )continue;
        s[i].islower();
    }
cout << "AC"<<endl;
}
else {cout << "WA" <<endl;}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:14: error: request for member 'islower' in 's.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   16 |         s[i].islower();
      |              ^~~~~~~
Language: C++

#include <iostream>
#include<string>
#include <cctype>
using namespace std;
int main(){
string s;
int m;
cin >> s;
if (s[0]== 'A' ){
    for (int i =2 ;i<s.length();i++ ){
         if (s[i]  =='C' ){
            m=i;
            break;}   }
    for (int i =1;i<s.length();i++){
        if (i =m )continue;
        s[i].islower();
    }
}
cout << "AC"<<endl;
else {cout << "WA" <<endl;}
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:14: error: request for member 'islower' in 's.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   16 |         s[i].islower();
      |              ^~~~~~~
a.cc:20:1: error: 'else' without a previous 'if'
   20 | else {cout << "WA" <<endl;}
      | ^~~~
Language: C++

#include <iostream>
#include<string>
#include <cctype>
using namespace std;
int main(){
string s;
int m;
cin >> s;
if (s[0]== 'A' ){
    for (int i =2 ;i<s.length();i++ ){
         if (s[i]  =='C' ){
            m=i;
            break;}   }
    for (int i =1;i<s.length();i++){
        if (i =m )continue;
        s[i].islower();
    }
}
cout << "AC"<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:14: error: request for member 'islower' in 's.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   16 |         s[i].islower();
      |              ^~~~~~~
Language: C++

#include <iostream>
#include<string>
#include <cctype>
using namespace std;
int main(){
string s;
int m;
cin >> s;
if (s[0]== 'A' ){
    for (int i =2 ;i<s.length();i++ ){
         if (s[i]  =='C' ){
            m=i;
            break;}   }
    for (int i =1;i<s.length();i++){
        if (i =m )continue;
        s[i].lower();
    }
}
cout << "AC"<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:14: error: request for member 'lower' in 's.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   16 |         s[i].lower();
      |              ^~~~~
Language: C++

#include <iostream>
#include<string>
#include <cctype>
using namespace std;
int main(){
string s;
int m;
int z = s.length()-2;
cin >> s;
if (s[0]== 'A' ){
    for (int i =2 ;i<z;i++ ){
         if (s[i]  =='C' ){
            m=i;
            break;}   }
    for (int i =1;i<s.length();i++){
        if (i =m )continue;
        s[i].lower();
    }
}
cout << "AC"<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:14: error: request for member 'lower' in 's.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   17 |         s[i].lower();
      |              ^~~~~
Language: C++

#include <iostream>
#include<string>
#include <cctype>
using namespace std;
int main(){
int z ;
string s;
cin >> s;
if (s[0]== 'A' ){
    for (int i =2 ;i<(s.length);i++ ){
        s[i]  =='C' ;
        z=i; }
    for (int i =1;i<s.length;i++){
        if (i =z){continue;}
        s[i].lower();
    }
}
cout << "AC"<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: 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 '()' ?)
   10 |     for (int i =2 ;i<(s.length);i++ ){
      |                      ~~~^~~~~~~
      |                                ()
a.cc:13:23: 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 '()' ?)
   13 |     for (int i =1;i<s.length;i++){
      |                     ~~^~~~~~
      |                             ()
a.cc:15:14: error: request for member 'lower' in 's.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   15 |         s[i].lower();
      |              ^~~~~
Language: C++

#include <iostream>
#include<string>
#include <cctype>
using namespace std;
int main(){
int z ;
string s;
cin >> s;
if (s[0]== 'A' ){
    for (int i =2 ;i<(s.length-2);i++ ){
        s[i]  =='C' ;
        z=i; }
    for (int i =1;i<s.length;i++){
        if (i =z){continue;}
        s[i].lower();
    }
}
cout << "AC"<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: 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 '()' ?)
   10 |     for (int i =2 ;i<(s.length-2);i++ ){
      |                       ~~^~~~~~
      |                               ()
a.cc:13:23: 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 '()' ?)
   13 |     for (int i =1;i<s.length;i++){
      |                     ~~^~~~~~
      |                             ()
a.cc:15:14: error: request for member 'lower' in 's.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   15 |         s[i].lower();
      |              ^~~~~
Language: C

#include <stdio.h>
int main(void){
  char a[12];
  int i,c=0,e=0;
  scanf("%s",a);
  if(a[0]!='A') e=1;
  if(!(a[1]>='a')) e=1;
  for(i=2;i<n-1;i++){
    if(a[i]=='C') c++;
    else if(!(a[i]>='a')) e=1;
  }
  if(c!=1) e=1;
  if(!(a[n-1]>='a')) e=1;
  printf(e==0?"AC":"WA");
  return 0;
}

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

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

int main() {
	string s;
	cin >> s;
	string k = "AC";
	string abc = "abcdefghijklmnopqrstuvwxyz";
	if(s.at(0) != 'A')
	{
		k = "WA";
	}
	else
	{
		int cc = 0;
		for(int i = 2;i < s.size()-1;i++)
		{
			if(s.at(i) == 'C')
			{
				cc++;
			}
		}
		if(cc != 1)
		{
			k = "WA";
		}
		else
		{
			for(int i = 1;i < s.size();i++)
			{
				if(i > 1 && s.at(i) == 'C')
				{
					continue;
				}
				int jc = 0;
				for(int j = 0;j < 26;j++)
				{
					if(s.at(i) == abc.(j))
					{
						jc++;
					}
				}
				if(jc == 0)
				{
					k = "WA";
				}
			}
		}
	}
    cout << k << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:59: error: expected unqualified-id before '(' token
   38 |                                         if(s.at(i) == abc.(j))
      |                                                           ^
Language: C++

#include <iostream>
using namespace std;
int main()
{
	string s;
	cin >> s;
	bool flag = true;
	for (int i = 0; i < 3; i++) {
		if (s[0] == 'A' && s[2] == 'C') {
		}
		else if ((int)s[1]<(int)'A' && (int)s[1]>(int)'Z') {
		}
		else {
			flag = false;
			cout << "AW";
			break;
		}
	}
	for (int i = 3; i < s.length; i++) {
		if ((int)s[3] >= (int)'a' && (int)s[4] <= (int)'z') {

		}
		else {
			flag = false;
			cout << "AW";
			break;
		}
	}
	if (flag) cout << "AC";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:31: 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 '()' ?)
   19 |         for (int i = 3; i < s.length; i++) {
      |                             ~~^~~~~~
      |                                     ()
Language: C++

#include<iostream>
using namespace std;
int main(){
    string s;
    cin>>s;
    int h=0;
    h= s[s.length()-1]=='C'?100:0;
    if((s[0]=='A')&&(int(s[1])>=97)){
    h+=1;  }
    if(h==1){
for(int i =2;i<s.length()-1;i++){
 if((s[i]=='C')&&(i<s.length()-1)){h+=1;}
 else if ((int(s[i])<97)&&(s[i]!='C')){ h=h+100;} }
    }
if(h==2&&n==0){
    cout<<"AC"<<"\n";}
else{
    cout<<"WA"<<"\n";}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:10: error: 'n' was not declared in this scope
   15 | if(h==2&&n==0){
      |          ^
Language: C++

using namespace std;
#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 all(v) v.begin(), v.end()
 
int main() {
  string S; cin >>S;
  bool hantei=true;
  int count=0;
  if(S[0]!='A')hantei=false;
  if(S[1]<97||S[1]>127)hantei=false;
  if(S[S.size()-1]<97||S[S.size()-1]>122)hantei=false;
  rep2(i,2,S.size()-1){
      int a;
      a=S[i];
      if(S[i]<97||S[i]>122){
        if(S[i]=='C'&&count==0){
          count++;
        }else{
          hantei=false;
        }
      }
  }
  if(count!=1)hantei=false;
  if(hantei){
    cout<<"AC"<<endl;
  }else{
    cout<<"WA"<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'string' was not declared in this scope
    7 |   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 | using namespace std;
a.cc:7:13: error: 'cin' was not declared in this scope
    7 |   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 | using namespace std;
a.cc:7:19: error: 'S' was not declared in this scope
    7 |   string S; cin >>S;
      |                   ^
a.cc:26:5: error: 'cout' was not declared in this scope
   26 |     cout<<"AC"<<endl;
      |     ^~~~
a.cc:26:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:26:17: error: 'endl' was not declared in this scope
   26 |     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 | using namespace std;
a.cc:28:5: error: 'cout' was not declared in this scope
   28 |     cout<<"WA"<<endl;
      |     ^~~~
a.cc:28:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:28:17: error: 'endl' was not declared in this scope
   28 |     cout<<"WA"<<endl;
      |                 ^~~~
a.cc:28:17: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'