Language: C++

#define _GLIBCXX_DEBUG//実行時、何も出なかったらこれを使う
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<cmath>
#include<queue>
#include<stack>
#include<map>
#include<numeric>
#include<climits>
#include<limits>//
#include <stdio.h>//
#include<cmath>
#include<iomanip>

using namespace std;

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

typedef long long ll;

template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }
template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }

int dy[] = {1,0,-1,0}; //次に行くところ
int dx[] = {0,1,0,-1}; //s上に同じ

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int n,cnt = 0;
  string s;
  cin >> s;
  n = s.size();

  if (s[0] != 'A' || ((s[i] < 97 || s[i] > 122)){
    cout << "WA\n";
    return 0;
  }
  

  for (int i = 2; i <= n-2; i++){
    if (s[i] == 'C'){
      cnt++;
    }
    if (cnt >= 2){
      cout << "WA\n";
      return 0;
    }
    if (s[i] != 'C' &&(s[i] < 97 || s[i] > 122)){
      cout << "WA\n";
      return 0;
    }
  }
  
  if (cnt == 1){
    cout << "AC\n";
  }else{
    cout << "WA\n";
  }
  
  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:26: error: 'i' was not declared in this scope
   38 |   if (s[0] != 'A' || ((s[i] < 97 || s[i] > 122)){
      |                          ^
a.cc:38:49: error: expected ')' before '{' token
   38 |   if (s[0] != 'A' || ((s[i] < 97 || s[i] > 122)){
      |      ~                                          ^
      |                                                 )
a.cc:44:19: error: 'i' was not declared in this scope
   44 |   for (int i = 2; i <= n-2; i++){
      |                   ^