Language: C++

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

int main() {
  int N;
  cin >> N;
  
  for (int i = 0; i < N; i++) {
    string x;
  	int p = 0;
    int y = 0;
    int g = 0;
    int w = 0;
  	cin >> x;
  	if (x == "P";p =! 1) {
      p++;
    }
  	if (x == "Y";y =! 1) {
      y++;
    }
    if (x == "G";g =! 1) {
      g++;
    }
    if (x == "W";w =! 1) {
      w++;
    }
    string A = 0;
    A = w + p + g + y;
    	if (i + 1 == N;A = 3)
          cout << "three" <<endl;
        if (i + 1 == N;A = 4)
          cout << "four" <<endl;  
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:15: warning: ignoring return value of 'bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]', declared with attribute 'nodiscard' [-Wunused-result]
   15 |         if (x == "P";p =! 1) {
      |             ~~^~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:3772:5: note: declared here
 3772 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
a.cc:18:15: warning: ignoring return value of 'bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]', declared with attribute 'nodiscard' [-Wunused-result]
   18 |         if (x == "Y";y =! 1) {
      |             ~~^~~~~~
/usr/include/c++/14/bits/basic_string.h:3772:5: note: declared here
 3772 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
a.cc:21:11: warning: ignoring return value of 'bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]', declared with attribute 'nodiscard' [-Wunused-result]
   21 |     if (x == "G";g =! 1) {
      |         ~~^~~~~~
/usr/include/c++/14/bits/basic_string.h:3772:5: note: declared here
 3772 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
a.cc:24:11: warning: ignoring return value of 'bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]', declared with attribute 'nodiscard' [-Wunused-result]
   24 |     if (x == "W";w =! 1) {
      |         ~~^~~~~~
/usr/include/c++/14/bits/basic_string.h:3772:5: note: declared here
 3772 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
a.cc:29:26: error: could not convert 'A.std::__cxx11::basic_string<char>::operator=(3)' from 'std::__cxx11::basic_string<char>' to 'bool'
   29 |         if (i + 1 == N;A = 3)
      |                        ~~^~~
      |                          |
      |                          std::__cxx11::basic_string<char>
a.cc:31:26: error: could not convert 'A.std::__cxx11::basic_string<char>::operator=(4)' from 'std::__cxx11::basic_string<char>' to 'bool'
   31 |         if (i + 1 == N;A = 4)
      |                        ~~^~~
      |                          |
      |                          std::__cxx11::basic_string<char>