Language: C++

#include<iostream>
#include<string>
int main()
{
  int n,c1=0,c2=0,c3=0,c4=0,i;
  string s1 = "AC";
  string s2 = "WA";
  string s3 = "TLE";
  string s4 = "RE";
  string s;
  cin>>n;
  for(i=0;i<n;i++)
  {
    cin>>s;
    if (s=="AC")
    {
      c1++;
    }
    else if (s=="WA")
    {
      c2++;
    }
    else if (s=="TLE")
    {
      c3++;
    }
    else
    {
      c4++;
    }
  }
  cout<<s1<<" x "<<c1<<endl;
  cout<<s2<<" x "<<c2<<endl;
  cout<<s3<<" x "<<c3<<endl;
  cout<<s4<<" x "<<c4<<endl;
  return 0;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string s1 = "AC";
      |   ^~~~~~
a.cc:6:3: 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:9: error: expected ';' before 's2'
    7 |   string s2 = "WA";
      |         ^~~
      |         ;
a.cc:8:9: error: expected ';' before 's3'
    8 |   string s3 = "TLE";
      |         ^~~
      |         ;
a.cc:9:9: error: expected ';' before 's4'
    9 |   string s4 = "RE";
      |         ^~~
      |         ;
a.cc:10:9: error: expected ';' before 's'
   10 |   string s;
      |         ^~
      |         ;
a.cc:11:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   11 |   cin>>n;
      |   ^~~
      |   std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:14:10: error: 's' was not declared in this scope
   14 |     cin>>s;
      |          ^
a.cc:32:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   32 |   cout<<s1<<" x "<<c1<<endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:32:9: error: 's1' was not declared in this scope; did you mean 'c1'?
   32 |   cout<<s1<<" x "<<c1<<endl;
      |         ^~
      |         c1
a.cc:32:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   32 |   cout<<s1<<" x "<<c1<<endl;
      |                        ^~~~
      |                        std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:33:9: error: 's2' was not declared in this scope; did you mean 'c2'?
   33 |   cout<<s2<<" x "<<c2<<endl;
      |         ^~
      |         c2
a.cc:34:9: error: 's3' was not declared in this scope; did you mean 'c3'?
   34 |   cout<<s3<<" x "<<c3<<endl;
      |         ^~
      |         c3
a.cc:35:9: error: 's4' was not declared in this scope; did you mean 'c4'?
   35 |   cout<<s4<<" x "<<c4<<endl;
      |         ^~
      |         c4