Language: C++

using namespace std;
int main() {
	string S;
	cin >> S;
	if (S[0] != 'A') {
		cout << "WA" << endl;
		return 0;
	}
	int i;
	int count = 0;
	for ( i = 0; i < 3; ++i) {
		if (S[i] == 'C')
			count++;
	}
	for ( i = S.size() - 1; i > S.size() - 3; --i) {
		if (S[i] == 'C')
			count++;
	}
	if (count != 1) {
		cout << "WA" << endl;
		return 0;
	}
	int count2 = 0;
	for (i = 0; i < S.size(); ++i) {
		if ('A' <= S[i] && 'Z' >= S[i]) {
			count2++;
		}
	}
	if (count2 != 2) {
		cout << "WA" << endl;
		return 0;
	}
	cout << "AC" << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'string' was not declared in this scope
    3 |         string 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:4:9: error: 'cin' was not declared in this scope
    4 |         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:4:16: error: 'S' was not declared in this scope
    4 |         cin >> S;
      |                ^
a.cc:6:17: error: 'cout' was not declared in this scope
    6 |                 cout << "WA" << endl;
      |                 ^~~~
a.cc:6:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:6:33: error: 'endl' was not declared in this scope
    6 |                 cout << "WA" << 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:20:17: error: 'cout' was not declared in this scope
   20 |                 cout << "WA" << endl;
      |                 ^~~~
a.cc:20:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:20:33: error: 'endl' was not declared in this scope
   20 |                 cout << "WA" << endl;
      |                                 ^~~~
a.cc:20:33: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:30:17: error: 'cout' was not declared in this scope
   30 |                 cout << "WA" << endl;
      |                 ^~~~
a.cc:30:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:30:33: error: 'endl' was not declared in this scope
   30 |                 cout << "WA" << endl;
      |                                 ^~~~
a.cc:30:33: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:33:9: error: 'cout' was not declared in this scope
   33 |         cout << "AC" << endl;
      |         ^~~~
a.cc:33:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:33:25: error: 'endl' was not declared in this scope
   33 |         cout << "AC" << endl;
      |                         ^~~~
a.cc:33:25: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'