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

using namespace std;
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
 
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++;
          continue;
        }else{
          hantei=false;
        }
      }
  }
  if(hantei){
    cout<<"AC"<<endl;
  }else{
    cout<<"WA"<<endl;
  }
  return 0;
}

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'x' was not declared in this scope
   11 |     x++;
      |     ^
a.cc:15:9: error: 'y' was not declared in this scope
   15 |         y++;
      |         ^
a.cc:19:9: error: 'z' was not declared in this scope
   19 |         z++;
      |         ^
a.cc:22:4: error: 'x' was not declared in this scope
   22 | if(x==1 && y==1 && z==2)
      |    ^
a.cc:22:12: error: 'y' was not declared in this scope
   22 | if(x==1 && y==1 && z==2)
      |            ^
a.cc:22:20: error: 'z' was not declared in this scope
   22 | if(x==1 && y==1 && z==2)
      |                    ^
Language: C++

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

Compiler output:
a.cc:1:20: warning: extra tokens at end of #include directive
    1 | #include <iostream>;
      |                    ^
a.cc: In function 'int main()':
a.cc:19:20: error: expected '}' at end of input
   19 |         return 0; }
      |                    ^
a.cc:3:12: note: to match this '{'
    3 | int main() {
      |            ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:22:13: error: expected ';' before '}' token
   22 |     return 0
      |             ^
      |             ;
   23 | }else{
      | ~
Language: C++

#include <iostream>

using namespace std;
int main()
{
string s;
cin>>s;
int x=0 ,y=0 ,z=0;
if (s[0]=='A') x=1;
for (int i=2 ;i<s.size()-2;i++ ){
    if(s[i]=='C')
        y++;
}
for (int i=0 ;i<s.size();i++ ){
    if(s[i]>64 && s[i]<91){
        z++;
    }
}
if(x==1 && y==1 && z==2) cout<< "AC";
else cout<< "WA";
return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:21:10: error: expected '}' at end of input
   21 | return 0;
      |          ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

#include <iostream>
using namespace std;
int main()
{
string s;
cin>>s;
int x=0 ,y=0 ,z=0;
if (s[0]=='A') x=1;
for (int i=2 ;i<s.size()-2;i++ ){
    if(s[i]=='C')
        y++;
}
for (int i=0 ;i<s.size();i++ ){
    if(s[i]>64 && s[i]<91){
        z++;
    }
}
if(x==1 && y==1 && z==2) cout<< "AC";
else cout<< "WA";
return 0;


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

#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
using namespace std;
int main()
{
string s;
cin>>s;
int x=0 ,y=0 ,z=0;
if (s[0]=='A') x=1;
for (int i=2 ;i<s.size()-2;i++ ){
    if(s[i]=='C')
        y++;
}
for (int i=0 ;i<s.size();i++ ){
    if(s[i]>64 && s[i]<91){
        z++;
    }
}
if(x==1 && y==1 && z==2) cout<< "AC";
else cout<< "WA";
return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:23:10: error: expected '}' at end of input
   23 | return 0;
      |          ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C

#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
using namespace std;
int main()
{
string s;
cin>>s;
int x=0 ,y=0 ,z=0;
if (s[0]=='A') x=1;
for (int i=2 ;i<s.size()-2;i++ ){
    if(s[i]=='C')
        y++;
}
for (int i=0 ;i<s.size();i++ ){
    if(isupper(s[i])){
        z++;
    }
}
if(x==1 && y==1 && z==2) cout<< "AC";
else cout<< "WA";
return 0;
}


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

#include <iostream>
#include <string>
#include <math>
#include <algorithm>
using namespace std;
int main()
{
string s;
cin>>s;
int x=0 ,y=0 ,z=0;
if (s[0]=='A') x=1;
for (int i=2 ;i<s.size()-2;i++ ){
    if(s[i]=='C')
        y++;
}
for (int i=0 ;i<s.size();i++ ){
    if(isupper(s[i])){
    z++;
    }
}
if(x==1 && y==1 && z==2) cout<< "AC";
else cout<< "WA";
return 0;
}

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

//#define _GLIBCXX_DEBUG

#include<bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
const int INF= 1e9+5;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>>vvi;


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

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

#include <iostream>
#include <string>
using namespace std;
 
int main()
{
    string S; int noC = 0 ,C_location;
    cin >> S;
    if(S[0]!='A'){cout << "WA"; return 0;}
    else {for(int i=2 ; i<(S.size()-1); i++)
        {
         if(S[i]=='C'){ C_location=i; noC++;}
         else {cout<< "WA"; return0;}
        }
    for(int i=1; i<S.size();i++)
    {
        if(int (S[i])>=65 && int (S[i]) <= 90)
        {   if(i!=C_location){cout<< "WA"; return 0;}
 
        }
    }
     if(noC==1)
     {
         cout << "AC";
     }}
 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:29: error: 'return0' was not declared in this scope
   13 |          else {cout<< "WA"; return0;}
      |                             ^~~~~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;
 
int main()
{
    string S; int noC = 0 ,C_location;
    cin >> S;
    if(S[0]!='A'){cout << "WA"; return 0;}
    for(int i=2 ; i<(S.size()); i++)
        {
         if(S[i]=='C'){ C_location=i; noC++;}
         if(S[i]=='c' ){ if(i<(S.size()-2){ cout<<"WA"; return 0 ;}}
        }
    for(int i=1; i<S.size();i++)
    {
        if(int (S[i])>=65 && int (S[i]) <= 90)
        {   if(i!=C_location){cout<< "WA"; return 0;}
 
        }
    }
     if(noC==1)
     {
         cout << "AC";
     }
 
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:43: error: expected ')' before '{' token
   13 |          if(S[i]=='c' ){ if(i<(S.size()-2){ cout<<"WA"; return 0 ;}}
      |                            ~              ^
      |                                           )
a.cc:13:68: error: expected primary-expression before '}' token
   13 |          if(S[i]=='c' ){ if(i<(S.size()-2){ cout<<"WA"; return 0 ;}}
      |                                                                    ^
Language: C++

#include <iostream>
#include <string>
using namespace std;
 
int main()
{
    string S; int noC = 0 ,C_location;
    cin >> S;
    if(S[0]!='A'){cout << "WA"; return 0;}
    for(int i=2 ; i<(S.size()); i++)
        {
         if(S[i]=='C'){ C_location=i; noC++;}
         if(S[i]=='c' ){ if(i<(S.size()-2){ cout<<"WA"; return 0 ;}}
        }
    for(int i=1; i<S.size();i++)
    {
        if(int (S[i])>=65 && int (S[i]) <= 90)
        {   if(i!=C_location){cout<< "WA"; return 0;}
 
        }
    }
     if(noC==1)
     {
         cout << "AC";
     }
 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:43: error: expected ')' before '{' token
   13 |          if(S[i]=='c' ){ if(i<(S.size()-2){ cout<<"WA"; return 0 ;}}
      |                            ~              ^
      |                                           )
a.cc:13:68: error: expected primary-expression before '}' token
   13 |          if(S[i]=='c' ){ if(i<(S.size()-2){ cout<<"WA"; return 0 ;}}
      |                                                                    ^
Language: C++

#include <iostream>
#include <string>
using namespace std;
 
int main()
{
    string S; int noC = 0 ,C_location;
    cin >> S;
    if(S[0]!='A'){cout << "WA"; return 0;}
    for(int i=2 ; i<(S.size()); i++)
        {
         if(S[i]=='C'){ C_location=i; noC++;}
         if(S[i]=='c' && i<(S.size()-2){ cout<<"WA"; return 0 ;}
        }
    for(int i=1; i<S.size();i++)
    {
        if(int (S[i])>=65 && int (S[i]) <= 90)
        {   if(i!=C_location){cout<< "WA"; return 0;}
 
        }
    }
     if(noC==1)
     {
         cout << "AC";
     }
 
    return 0;
}
 

Compiler output:
a.cc: In function 'int main()':
a.cc:13:40: error: expected ')' before '{' token
   13 |          if(S[i]=='c' && i<(S.size()-2){ cout<<"WA"; return 0 ;}
      |            ~                           ^
      |                                        )
a.cc:14:9: error: expected primary-expression before '}' token
   14 |         }
      |         ^
Language: C++

#include <iostream>
using namespace std;
int main(){
string S,messg;
cin >> S;
if (S[0]=='A'&&S[2]=='C'){
 for(int i=1; i<S.length();i++){
    if (i==3)break;
    if (S[i]=='C')messg="WA";
    if (S[i]>90 && S[i]<123){
       messg= "AC";
    }
}}else messg ="WA";
cout << messg;

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

#include <iostream>
using namespace std;
string S;
int a;
int main(){
    cin>>S;
    if (S.front== 'A'){
        for (int i=2; i<S.size()-2; i++){
            if (S[i]=='C')a++;
        }
        if (a==1){
            a=0;
            for (int i=0; i<S.size(); i++){
                a += (S[i]>='a' && S[i]<='z');
            }
            if (a+2 == S.size()){cout<<"AC";return 0;}
        }

    }cout<<"WA";
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: invalid operands of types '<unresolved overloaded function type>' and 'char' to binary 'operator=='
    7 |     if (S.front== 'A'){
      |         ~~~~~~~^~ ~~~
      |           |       |
      |           |       char
      |           <unresolved overloaded function type>
Language: C++

#include <iostream>
using namespace std;
string S;
int a;
int main(){
    cin>>S;
    if (S.front== 'A'){
        for (int i=2; i<S.size()-2; i++){
            if (S[i]=='C')a++;
        }
        if (a==1){
            a=0;
            for (int i=0; i<S.size(); i++){
                a += (S[f]>='a' && S[f]<='z');
            }
            if (a+2 == S.size()){cout<<"AC";return 0;}
        }

    }cout<<"WA";
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: invalid operands of types '<unresolved overloaded function type>' and 'char' to binary 'operator=='
    7 |     if (S.front== 'A'){
      |         ~~~~~~~^~ ~~~
      |           |       |
      |           |       char
      |           <unresolved overloaded function type>
a.cc:14:25: error: 'f' was not declared in this scope
   14 |                 a += (S[f]>='a' && S[f]<='z');
      |                         ^
Language: C++

using namespace std;
string S;
int a;
int main(){
    cin>>S;
    if (S[0]== 65){
        for (int i=2; i<S.size()-2; i++){
            if (S[i]==67)a++;
        }
        if (a==1){
            a=0;
            for (int f=0; f<S.size(); f++){
                a += (S[f]>='a' && S[f]<='z');
            }
            if (a+2 == S.size()){cout<<"AC";return 0;}
        }

    }cout<<"WA";
    return 0;
}

Compiler output:
a.cc:2:1: error: 'string' does not name a type
    2 | string S;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope
    5 |     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:5:10: error: 'S' was not declared in this scope
    5 |     cin>>S;
      |          ^
a.cc:15:34: error: 'cout' was not declared in this scope
   15 |             if (a+2 == S.size()){cout<<"AC";return 0;}
      |                                  ^~~~
a.cc:15:34: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:18:6: error: 'cout' was not declared in this scope
   18 |     }cout<<"WA";
      |      ^~~~
a.cc:18:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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

#define pb push_back
#define F first
#define S second
#define fo(i,a,b)  for(int i = a; i < b; i++)

using ll = long long;
using ld = long double;
using ul = unsigned long long;
using ii = pair<int, int>;
#define Mosta     ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ReadFile            freopen("input.in","r",stdin)
#define WriteFile           freopen("output.txt","w",stdout)
const ll mod7 = 1000000007,mod = 1000000000,OO = 0x3f3f3f3f;
const ld EPS = 1e-7;
double Pi=acos(-1);
const ld rad=Pi/180.0;
ll power(ll x, ll y, ll p)
{
    ll res = 1;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}
ll nCr (ll n,ll m)
{
        return(m == 0)?1:n*nCr(n-1,m-1)/m;
}
/*****************************************************/


int main()
{
    string s , x = "AC";
    cin >> s;
    int m = 0;
    if(s[0] != 'A')
        x = "WA";
    
    for(int i = 1; i < s.length(); ++i)
        if(isupper(s[i])){
            if(i == 1 || i == s.length() - 1 || s[i] != 'C')
                x = "WA"
            m++;
        }
    if(m != 1)
        x = "WA"
        
    cout << x << "\n";

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:51:25: error: expected ';' before 'm'
   51 |                 x = "WA"
      |                         ^
      |                         ;
   52 |             m++;
      |             ~            
a.cc:55:17: error: expected ';' before 'cout'
   55 |         x = "WA"
      |                 ^
      |                 ;
   56 | 
   57 |     cout << x << "\n";
      |     ~~~~
Language: C++

#include <iostream>

using namespace std;

int main()
{
    string s; int counter = 0;
    cin >> s;
    int sz = s.size();
    for(int i = 0 ; i < sz ; i++){
        if(islower(s[i])){
            counter ++;
        }
    }
    if (s[0] == 'A' && counter == sz - 2 ){
        for(int i = 2 ; i<sz ; i++){
            if(s[i] == 'C'){
                cout << "AC"<<endl;
            }

        }
        else cout << "WA" <<endl;
    }
    else cout << "WA" <<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:9: error: expected '}' before 'else'
   22 |         else cout << "WA" <<endl;
      |         ^~~~
a.cc:15:43: note: to match this '{'
   15 |     if (s[0] == 'A' && counter == sz - 2 ){
      |                                           ^
a.cc: At global scope:
a.cc:24:5: error: expected unqualified-id before 'else'
   24 |     else cout << "WA" <<endl;
      |     ^~~~
a.cc:25:5: error: expected unqualified-id before 'return'
   25 |     return 0;
      |     ^~~~~~
a.cc:26:1: error: expected declaration before '}' token
   26 | }
      | ^
Language: C++

#include <iostream>
#include <string>
#include <cctype> 
using namespace std;
int main(){
	int k,i,z;
	string s;
	int c=0;
	cin>>s;
	if (((s[0]!='A')|| (s[s.size()-1]=='C')) ){
		cout<<"WA";
		return 0;
	}
	for (i=2;i<s.size()-1;i++){
	if (s[i]=='C')
	c++;
	 z=i;
}
	if (c!=1 ){
			cout<<"WA";
		return 0;
	} 
	
	for (i=1;i<s.size();i++){
		if (i==z)
		int n=0;
		
		else if (isupper(s[i])){
			cout<<"WA";
		return 0;
		} }
	
		cout<<"AC";
		

	return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:36:18: error: expected '}' at end of input
   36 |         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(){
	int k,i;
	string s;
	int c=0;
	cin>>s;
	if ((s[0]!='A')  ){
		cout<<"WA";
		return 0;
	}
	for (i=s.size()-2;i>1;i--){
	
	if (s[i]=='C')
	c++;
}
	if (c<=1){
			cout<<"WA";
		return 0;
	} 
	
	for (i=1;i<s.size();i++){
		if (i==2)
		n=0;
		
		else if (isupper(s[i])){
			cout<<"WA";
		return 0;
		} }
	
		cout<<"AC";
		

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:17: error: 'n' was not declared in this scope
   26 |                 n=0;
      |                 ^
Language: C++

#include <iostream>
#include <string>
#include <cctype> 
using namespace std;
int main(){
	int k,i;
	string s;
	
	cin>>s;
	if ((s[0]!='A') || ((s[2]!='C') || (s[s.size()-2]!='C')  ) ){
		cout<<"WA";
		return 0;
	}
	
	for (i=1;i<s.size();i++){
		if (i==2)
		n=0;
		
		else if (isupper(s[i])){
			cout<<"WA";
		return 0;
		} }
	
		cout<<"AC";
		

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: 'n' was not declared in this scope
   17 |                 n=0;
      |                 ^
Language: C++

#include <iostream>
#include <string>
#include <cctype> 
using namespace std;
int main(){
	int n,k,i;
	string s;
	k=1;
	cin>>s;
	if ((s[0]!='A') || ((s[2]!='C') || (s[s.size()-2]!='C') || (s[s.size()-1]!='C')){
		cout<<"WA";
		return 0;
	}
	
	for (i=1;i<s.size();i++){
		if (i==2)
		n=0;
		
		else if (isupper(s[i])){
			cout<<"WA";
		return 0;
		} }
	
		cout<<"AC";
		

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:89: error: expected ')' before '{' token
   10 |         if ((s[0]!='A') || ((s[2]!='C') || (s[s.size()-2]!='C') || (s[s.size()-1]!='C')){
      |            ~                                                                            ^
      |                                                                                         )
a.cc:15:32: error: expected ';' before ')' token
   15 |         for (i=1;i<s.size();i++){
      |                                ^
      |                                ;
Language: C++

#include <cctype> 
using namespace std;
int main(){
	int n,k,i;
	string s;
	k=1;
	cin>>s;
	if ((s[0]!='A') || (s[2]!='C')){
		cout<<"WA";
		return 0;
	}
	
	for (i=1;i<s.size();i++){
		if (i==2)
		n=0;
		
		else if (isupper(s[i])){
			cout<<"WA";
		return 0;
		} }
		if (k==1)
		cout<<"AC";
		

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'string' was not declared in this scope
    5 |         string s;
      |         ^~~~~~
a.cc:2:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    1 | #include <cctype>
  +++ |+#include <string>
    2 | using namespace std;
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin>>s;
      |         ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <cctype>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:7:14: error: 's' was not declared in this scope
    7 |         cin>>s;
      |              ^
a.cc:9:17: error: 'cout' was not declared in this scope
    9 |                 cout<<"WA";
      |                 ^~~~
a.cc:9:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:18:25: error: 'cout' was not declared in this scope
   18 |                         cout<<"WA";
      |                         ^~~~
a.cc:18:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:22:17: error: 'cout' was not declared in this scope
   22 |                 cout<<"AC";
      |                 ^~~~
a.cc:22:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <iostream>

using namespace std;

int main()
{

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

Compiler output:
a.cc: In function 'int main()':
a.cc:25:29: error: invalid initialization of reference of type 'std::ios_base&' from expression of type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   25 |                 if(uppercase(s[i]))
      |                    ~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/ios_base.h:1021:23: note: in passing argument 1 of 'std::ios_base& std::uppercase(ios_base&)'
 1021 |   uppercase(ios_base& __base)
      |             ~~~~~~~~~~^~~~~~
Language: C++

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

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

    int len = S.size();
    bool ans = "AC";
    if (S[0] != 'A') {
        and="WA"
    }

    int cnt_c = 0;
    for (int i=1; i<len; i++){
        if (S[i]>='A' && S[i]<='Z' ){
            if(i==1 || i==len-1 || S[i] !='C') {
                ans = "WA";
            else ++cnt_c;
        } 
    }
    if(cnt_c!=1) ans = "WA";
    cout << ans <<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:12: error: expected identifier before '=' token
   12 |         and="WA"
      |            ^
a.cc:20:13: error: expected '}' before 'else'
   20 |             else ++cnt_c;
      |             ^~~~
a.cc:18:48: note: to match this '{'
   18 |             if(i==1 || i==len-1 || S[i] !='C') {
      |                                                ^
Language: C++

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

int main() {
  string S;
  cin >> S;
  string ans = "AC";
  if (S.at(0) != 'A') ans = "WA";
  if (S.at(1) < 'a' || S.at(1) > 'z') ans = "WA";
  if (ans == "AC") {
    int N, ex;
    N = S.size();
    ex = 0;
    for (int i = 2; i < N - 1; i++) {
      if ((S.at(i) < 'a' || S.at(i) > 'z') && S.at(i) != C) {
        ans = "WA";
        break;
      }
      else if (S.at(i) == 'C' && ex == 0) ex = 1;
      else if (S.at(i) == 'C' && ex == 1) {
        ans = "WA";
        break;
      }
    }
    if (S.at(N - 1) < 'a' || S.at(N - 1) > 'z') ans = "WA";
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:58: error: 'C' was not declared in this scope
   15 |       if ((S.at(i) < 'a' || S.at(i) > 'z') && S.at(i) != C) {
      |                                                          ^
Language: C++

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

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

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

int main() {
  string s;
  cin >> s;
  bool b = 1, c = 1;
  rep(i, s.size()){
    if(i == 0){
      if(s[i] != 'A'){
        b = 0;
        break;
      }
    }
    else if(c && i > 1 && i < s.size()-1) && s[i] == 'C') c = 0;
    else if(s[i] < 'a'){
      b = 0;
      break;
    }
  }
  if(b && !c) cout << "AC" << endl;
  else cout << "WA" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:47: error: expected ';' before '[' token
   17 |     else if(c && i > 1 && i < s.size()-1) && s[i] == 'C') c = 0;
      |                                               ^
      |                                               ;
a.cc:17:46: error: label 's' used but not defined
   17 |     else if(c && i > 1 && i < s.size()-1) && s[i] == 'C') c = 0;
      |                                              ^
Language: C++

#pragma gcc optimize("Ofast")
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort(ALL(V)) //小さい方からソート
#define REV(V) reverse(ALL(V)) //リバース
#define RSORT(V) SORT(V);REV(V) //大きい方からソート
#define NPN(V) next_permutation(ALL(V)) //順列
#define pb(n) push_back(n)
#define endl '\n'
#define Endl '\n'
#define DUMP(x)  cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define Yay(n) cout << ((n) ? "Yay!": ":(") << endl
#define RAPID cin.tie(0);ios::sync_with_stdio(false)
#define VSUM(V) accumulate(ALL(V), 0)
#define MID(a,b,c) (a) < (b) && (b) < (c)
#define MIDe(a,b,c) (a) <= (b) && (b) <= (c)
#define IN(n) cin >> n
#define IN2(a,b) cin >> a >> b
#define IN3(a,b,c) cin >> a >> b >> c 
#define IN4(a,b,c,d) cin >> a >> b >> c >> d
#define VIN(V) for(int i = 0; i < (V).size(); i++) {cin >> (V).at(i);}
#define OUT(n) cout << n << endl
#define VOUT(V) REP(i, (V).size()) {cout << (V)[i] << endl;}
#define VOUT2(V) REP(i, (V).size()) {cout << (V)[i] << " ";} cout<<endl;

// 型マクロ定義
#define int long long
#define P pair<ll,ll>
#define Vi vector<ll>
#define Vd vector<double>
#define Vs vector<string>
#define Vc vector<char>
#define M map<ll,ll>
#define S set<ll>
#define PQ priority_queue<ll>
#define PQG priority_queue<ll,V,greater<ll>
//

const int MOD = 1000000007;
const int INF = 1061109567;
const double EPS = 1e-10;
const double PI  = acos(-1.0);

int gcd(int a,int b){return b != 0 ? gcd(b, a % b) : a;} //最大公約数
int lcm(int a, int b){return a * b / gcd(a, b);}
string toStrUp(string str){char diff = 'A'-'a';REP(i,str.size()) str[i] += diff;return str;}
string gCh(string str, int key){return str.substr(key,1);}

signed main() {
  RAPID;
  // デフォルト変数定義
  int n=0,m=0,a=0,b=0,c=0,d=0,x=0,y=0,z=0;
  string s="",t="";
  //

  // ここから
  IN(s);
  bool test1 = s[0] == 'A';
  int test2 = 0;
  bool test3 = true;
  FOR(i,2,s.size()-1){
    if(s[i]=='C') test2++;
    else if((s[i]>= 'A') && (s[i]<='Z')) test3 = false;
  }
  bool test4 = !((s[s.size()-1]>= 'A') && (s[s.size()-1]<='Z'))
  if(test1 && test2==1 && test3 && test4) OUT("AC");
  else OUT("WA");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:74:3: error: expected ',' or ';' before 'if'
   74 |   if(test1 && test2==1 && test3 && test4) OUT("AC");
      |   ^~
a.cc:75:3: error: 'else' without a previous 'if'
   75 |   else OUT("WA");
      |   ^~~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:13:35: error: continue statement not within a loop
   13 |   if ('a' <= s[1] || s[1] <= 'z') continue;
      |                                   ^~~~~~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:26: error: 'c' was not declared in this scope
   14 |     if(isupper(S.at(i))) c++;
      |                          ^
Language: C++

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

int main() {
  string s;
  int count;
  cin >> s;
  for (int i=2; i<s.size()-1; i++) {
    if (isupper(s[i])) count++;
  }
  if (s[0]=="A" && islower(s[1]) && islower(s[s.size()-1]) && count==1) cout << "AC";
  else cout << "WA";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |   if (s[0]=="A" && islower(s[1]) && islower(s[s.size()-1]) && count==1) cout << "AC";
Language: C++

#include <iostream>

using namespace std;

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

    if (*s.begin() == 'A') {
        if (count(++++s.begin(), --s.end(), 'C') == 1) {
            auto iter = find(s.begin(), s.end(), 'C');
            if (all_of(++s.begin(), iter, [](char c) {
                return islower(c);
            })
            and all_of(++iter, s.end(), [](char c) {
                return islower(c);
            })) {
                cout << "AC" << endl;
                return 0;
            }
        }
    }

    cout << "WA" << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: 'count' was not declared in this scope
   10 |         if (count(++++s.begin(), --s.end(), 'C') == 1) {
      |             ^~~~~
a.cc:11:29: error: no matching function for call to 'find(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, char)'
   11 |             auto iter = find(s.begin(), s.end(), 'C');
      |                         ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:11:29: note:   '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   11 |             auto iter = find(s.begin(), s.end(), 'C');
      |                         ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:12:17: error: 'all_of' was not declared in this scope
   12 |             if (all_of(++s.begin(), iter, [](char c) {
      |                 ^~~~~~
Language: C++

#include <iostream>

using namespace std;

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

    if (*s.begin() == 'A') {
        if (count(++++s.begin(), --s.end(), 'C') == 1) {
            auto iter = find(s.begin(), s.end(), 'C');
            if (all_of(++s.begin(), iter, [](char c) {
                return islower(c);
            })
            and all_of(++iter, s.end(), [](char c) {
                return islower(c);
            })) {
                cout << "AC" << endl;
                return 0;
            }
        }
    }

    cout << "WA" << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: 'count' was not declared in this scope
   10 |         if (count(++++s.begin(), --s.end(), 'C') == 1) {
      |             ^~~~~
a.cc:11:29: error: no matching function for call to 'find(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, char)'
   11 |             auto iter = find(s.begin(), s.end(), 'C');
      |                         ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:11:29: note:   '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   11 |             auto iter = find(s.begin(), s.end(), 'C');
      |                         ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:12:17: error: 'all_of' was not declared in this scope
   12 |             if (all_of(++s.begin(), iter, [](char c) {
      |                 ^~~~~~
Language: C++

#include <stdio.h>

int main() {
  char str[11];
  
  scanf("%s",str);
  bool result = true;
  if( str[0]!='A' ) {
  
	int numC = -1;
  	int ncount = 0;
  	for(int i=2;i<strlen(str)-1;i++) {
    	if(str[i]=='C') numC = i, ncount++;
  	}
  	if( ncount!=1 ) result=false, goto end;
  
  	for(int i=1;i<strlen(str);i++) {
      if( i!=numC && str[i]>='A' )
        result = false, goto end;
  	}
  }
  end:;
  
  if( result ) printf("AC");
  else printf("WA");
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:23: error: 'strlen' was not declared in this scope
   12 |         for(int i=2;i<strlen(str)-1;i++) {
      |                       ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <stdio.h>
  +++ |+#include <cstring>
    2 | 
a.cc:15:39: error: expected primary-expression before 'goto'
   15 |         if( ncount!=1 ) result=false, goto end;
      |                                       ^~~~
a.cc:17:23: error: 'strlen' was not declared in this scope
   17 |         for(int i=1;i<strlen(str);i++) {
      |                       ^~~~~~
a.cc:17:23: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:19:25: error: expected primary-expression before 'goto'
   19 |         result = false, goto end;
      |                         ^~~~
Language: C++

#include<iostream>
#include<cstring>
#include<string.h>
#include <algorithm>

using namespace std;

int main()
{

	string S;
	int l;

	getline(cin, S);
	  
	l = S.size();
	string sub_str = S.substr(3,l);

	bool ans = all_of(sub_str.begin(), sub_str.end(), &::isupper)

	if (isupper(S[0]) && islower(S[1]) && isupper(S[2]) && ans)
	{

	   cout << "AC" << "\n";
	}
	else
	{
	   cout << "WA" << "\n";
	}
	  
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: expected ',' or ';' before 'if'
   21 |         if (isupper(S[0]) && islower(S[1]) && isupper(S[2]) && ans)
      |         ^~
a.cc:26:9: error: 'else' without a previous 'if'
   26 |         else
      |         ^~~~
Language: C++

#include<iostream>
#include<cstring>
#include<string.h>
#include <algorithm>

using namespace std;

int main()
{

	 string S;
	 int l;

	 getline(cin, S);
	  
	 l = S.size();
	 string sub_str = S.substr(3,l);

	 bool ans = all_of(sub_str.begin(), sub_str.end(), &::isupper)

	 if (isupper(S[0]) && islower(S[1]) && isupper(S[2]) && ans)
	     cout << "AC" << "\n";
	 else
	     cout << "WA" << "\n";
	  
	 return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:21:10: error: expected ',' or ';' before 'if'
   21 |          if (isupper(S[0]) && islower(S[1]) && isupper(S[2]) && ans)
      |          ^~
a.cc:23:10: error: 'else' without a previous 'if'
   23 |          else
      |          ^~~~
a.cc:26:19: error: expected '}' at end of input
   26 |          return 0;
      |                   ^
a.cc:9:1: note: to match this '{'
    9 | {
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
signed main(){
  string S,ans="AC";
  cin>>S;
  int N=S.size();
  bool flag=0;
  if(S[0]!='A')
    ans="WA";
  if('a'>S[1]||S[1]>'z')
    ans="WA";
  int count=0;
  rep(i,2,N-1){
    if(S[i]=='C'){
      count++;
      if(count==2){
        ans="WA";
        break;
        }
      }
    else if(S[i]<'a'||'z'<S[i]){
      ans="WA";
      break;
      }
    }
  if(S[N-1]<'a'||'z'<S[N-1])
    ans="WA";
    }
  cout<<ans;
  }


Compiler output:
a.cc:40:3: error: 'cout' does not name a type
   40 |   cout<<ans;
      |   ^~~~
a.cc:41:3: error: expected declaration before '}' token
   41 |   }
      |   ^
Language: C++

///スマホコーディング
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<int(n);++i)
typedef long long ll;
const int inf=1e9;
int main(){
  string s;cin>>s;
  string ans="AC";
  if(s[0]!='A')ans="WA";
  int l=s.size();
  int cntc=0;
  int cnta=0;
  for(int i=1;i<l;++i){
    if(isupper(s[i])&&(i==1||i==l-1)
      ans="WA";
    if(i>1&&i<l-1&&s[i]=='C')
      cntc++;
    if(isupper(s[i])
      cnta++;
  }
  if(cntc!=1||cnta!=1)
      ans="WA";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:37: error: expected ';' before 'ans'
   15 |     if(isupper(s[i])&&(i==1||i==l-1)
      |                                     ^
      |                                     ;
   16 |       ans="WA";
      |       ~~~                            
a.cc:17:5: error: expected primary-expression before 'if'
   17 |     if(i>1&&i<l-1&&s[i]=='C')
      |     ^~
a.cc:16:16: error: expected ')' before 'if'
   16 |       ans="WA";
      |                ^
      |                )
   17 |     if(i>1&&i<l-1&&s[i]=='C')
      |     ~~          
a.cc:15:7: note: to match this '('
   15 |     if(isupper(s[i])&&(i==1||i==l-1)
      |       ^
a.cc:19:21: error: expected ';' before 'cnta'
   19 |     if(isupper(s[i])
      |                     ^
      |                     ;
   20 |       cnta++;
      |       ~~~~           
a.cc:21:3: error: expected primary-expression before '}' token
   21 |   }
      |   ^
a.cc:20:14: error: expected ')' before '}' token
   20 |       cnta++;
      |              ^
      |              )
   21 |   }
      |   ~           
a.cc:19:7: note: to match this '('
   19 |     if(isupper(s[i])
      |       ^
a.cc:21:3: error: expected primary-expression before '}' token
   21 |   }
      |   ^
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main() {
  string s; bool flag = true;
  cin >> s; int cnt = 0;
  if (s[0] != 'A')flag = false;
  if ('A' <= s[1] && s[i] <= 'Z')flag = false;
  if ('A' <= s[s.length() - 1] && s[s.length() - 1] <= 'Z')flag = false;
  if (flag) {
    for (int i = 2; i < s.length() - 1; i++) {
      if (s[i] == 'C')cnt++;
      if ('A' <= s[i] && s[i] <= 'Z' && s[i] != 'C')flag = false;
    }
  }
  if (flag && cnt == 1)cout << "AC" << endl;
  else cout << "WA" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:24: error: 'i' was not declared in this scope
    8 |   if ('A' <= s[1] && s[i] <= 'Z')flag = false;
      |                        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
signed main(){
  int a=0,b=1,r=0,n=0;
  string c;
  cin>>c;
  if(c[0]=='A') a=1;
  if(a){
    for(int i=1;i<a.size();i++){
      if(c[i]>'Z') b=0;
      if(a[i]=='C'&&i==1) r++;
    }
    if(r==1) n=1;
  }
  if(n&a&b) cout<<"AC";
  else cout<<"WA";
  cout<<"\n";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:21: error: request for member 'size' in 'a', which is of non-class type 'int'
    9 |     for(int i=1;i<a.size();i++){
      |                     ^~~~
a.cc:11:11: error: invalid types 'int[int]' for array subscript
   11 |       if(a[i]=='C'&&i==1) r++;
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
signed main(){
  int a=0,b;
  string c;
  cin>>c;
  if(c[0]=='A') a=1;
  if(a){
    for(int i=1;i<a.size();i++){
      if(c[i]>'Z') b=0
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:21: error: request for member 'size' in 'a', which is of non-class type 'int'
    9 |     for(int i=1;i<a.size();i++){
      |                     ^~~~
a.cc:10:23: error: expected ';' before '}' token
   10 |       if(c[i]>'Z') b=0
      |                       ^
      |                       ;
   11 |     }
      |     ~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'flag' was not declared in this scope
   18 |             if(!flag)
      |                 ^~~~
Language: C++

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

int main()
{
 string s;
  cin>>s;
  if(s[0]=='A')
  {
    if(islower(s[1])
       {
         bool flag=false;
         for(int i=2;i<s.length();i++)
         {
           if(s[i]=='C'&&!flag)
             flag=true;
           else if(flag==true&&s[i]=='C')
           {
             cout<<"WA\n";
             return 0;
           }
           else if(islower(s[i]))
             continue;
           else
           {cout<<"WA\n";
           return 0;
           }
                  
       }
    else
       {
         cout<<"WA\n";
         return 0;
       }
  }
  else
    cout<<"WA\n";
  
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:21: error: expected ';' before '{' token
   10 |     if(islower(s[1])
      |                     ^
      |                     ;
   11 |        {
      |        ~             
a.cc:36:3: error: expected primary-expression before 'else'
   36 |   else
      |   ^~~~
a.cc:35:4: error: expected ')' before 'else'
   35 |   }
      |    ^
      |    )
   36 |   else
      |   ~~~~
a.cc:10:7: note: to match this '('
   10 |     if(islower(s[1])
      |       ^
a.cc:41:2: error: expected '}' at end of input
   41 | }
      |  ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C

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

int main(void)
{
    char s[11];
    int ans=1,i,length,Cnum=0,Cindex=-1;

    scanf("%s",s);

    length=stlen(s);

    if(s[0]!='A') ans=0;

    for ( i = 2; i <= length-2; i++)
    {
        if(s[i]=='C')
        {
            Cnum++;
            Cindex=i;
        }
    }
    if(Cnum!=1) ans=0;

    for ( i = 0; i < length; i++)
    {
        if(i!=0&&i!=Cindex&&('A'<=s[i]||s[i]<='Z')) ans=0;
    }

    if(ans==1) printf("AC");
    else printf("WA");

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:12: error: implicit declaration of function 'stlen'; did you mean 'strlen'? [-Wimplicit-function-declaration]
   12 |     length=stlen(s);
      |            ^~~~~
      |            strlen
Language: C

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

int main(void)
{
    char s[11];
    int ans=1,i,length,Cnum=0,Cindex=-1;

    scanf("%s",s);

    length=stlen(s);

    if(s[0]!='A') ans=0;

    for ( i = 2; i <= length-2; i++)
    {
        if(s[i]=='C')
        {
            Cnum++;
            Cindex=i;
        }
    }
    if(Cnum!=1) ans=0;

    for ( i = 0; i < length; i++)
    {
        if(i!=0&&i!=Cindex&&('A'<=s[i]||s[i]<='Z')) ans=0;
    }

    if(ans==1) printf("AC");
    else printf("WA");

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:12: error: implicit declaration of function 'stlen' [-Wimplicit-function-declaration]
   11 |     length=stlen(s);
      |            ^~~~~