Language: C++



#include <iostream>
using namespace std;

int main()

{
a
    int arraysize, AC_count = 0, WA_count = 0, TLE_count = 0, RE_count = 0;

    char array[100];

    cin >> arraysize;

    for (int i = 0; i < arraysize; i++)

    {

        cin >> array[i];

        if (array[i] == "AC")

            AC_count++;

        else if (array[i] == "WA")

            WA_count++;

        else if (array[i] == "TLE")

            TLE_count++;

        else if (array[i] == "RE")

            RE_count++;

    }

    cout << "AC X " << AC_count << endl << "WA X " << WA_count << endl << "TLE X " << TLE_count << endl << "RE X " << RE_count << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:1: error: 'a' was not declared in this scope
    9 | a
      | ^
a.cc:14:12: error: 'arraysize' was not declared in this scope
   14 |     cin >> arraysize;
      |            ^~~~~~~~~
a.cc:22:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   22 |         if (array[i] == "AC")
      |             ~~~~~~~~~^~~~~~~
a.cc:24:13: error: 'AC_count' was not declared in this scope
   24 |             AC_count++;
      |             ^~~~~~~~
a.cc:26:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   26 |         else if (array[i] == "WA")
      |                  ~~~~~~~~~^~~~~~~
a.cc:28:13: error: 'WA_count' was not declared in this scope
   28 |             WA_count++;
      |             ^~~~~~~~
a.cc:30:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   30 |         else if (array[i] == "TLE")
      |                  ~~~~~~~~~^~~~~~~~
a.cc:32:13: error: 'TLE_count' was not declared in this scope
   32 |             TLE_count++;
      |             ^~~~~~~~~
a.cc:34:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   34 |         else if (array[i] == "RE")
      |                  ~~~~~~~~~^~~~~~~
a.cc:36:13: error: 'RE_count' was not declared in this scope
   36 |             RE_count++;
      |             ^~~~~~~~
a.cc:40:24: error: 'AC_count' was not declared in this scope
   40 |     cout << "AC X " << AC_count << endl << "WA X " << WA_count << endl << "TLE X " << TLE_count << endl << "RE X " << RE_count << endl;
      |                        ^~~~~~~~
a.cc:40:55: error: 'WA_count' was not declared in this scope
   40 |     cout << "AC X " << AC_count << endl << "WA X " << WA_count << endl << "TLE X " << TLE_count << endl << "RE X " << RE_count << endl;
      |                                                       ^~~~~~~~
a.cc:40:87: error: 'TLE_count' was not declared in this scope
   40 |     cout << "AC X " << AC_count << endl << "WA X " << WA_count << endl << "TLE X " << TLE_count << endl << "RE X " << RE_count << endl;
      |                                                                                       ^~~~~~~~~
a.cc:40:119: error: 'RE_count' was not declared in this scope
   40 |     cout << "AC X " << AC_count << endl << "WA X " << WA_count << endl << "TLE X " << TLE_count << endl << "RE X " << RE_count << endl;
      |                                                                                                                       ^~~~~~~~