Language: C++

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

int main(){
    int n == 1, w == 1, e == 1, s == 1;
    string s;
    cin >> s;
    for(i=0; i<s.length(); i++){
        if(s[i] == 'N'){
            n = 0;
        }else if(s[i] == 'W'){
            w = 0;
        }else if(s[i] == 'S'){
            s = 0;
        }else{
            e = 0;
        }
    }
    if(n^s || w^e){
        cout << "No";
    }else{
        cout << "Yes";
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:11: error: expected initializer before '==' token
    5 |     int n == 1, w == 1, e == 1, s == 1;
      |           ^~
a.cc:8:9: error: 'i' was not declared in this scope
    8 |     for(i=0; i<s.length(); i++){
      |         ^
a.cc:10:13: error: 'n' was not declared in this scope
   10 |             n = 0;
      |             ^
a.cc:12:13: error: 'w' was not declared in this scope
   12 |             w = 0;
      |             ^
a.cc:14:17: error: ambiguous overload for 'operator=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
   14 |             s = 0;
      |                 ^
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:817:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  817 |       operator=(const basic_string& __str)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:828:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  828 |       operator=(const _CharT* __s)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:840:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  840 |       operator=(_CharT __c)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:858:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  858 |       operator=(basic_string&& __str)
      |       ^~~~~~~~
a.cc:16:13: error: 'e' was not declared in this scope
   16 |             e = 0;
      |             ^
a.cc:19:8: error: 'n' was not declared in this scope
   19 |     if(n^s || w^e){
      |        ^
a.cc:19:15: error: 'w' was not declared in this scope
   19 |     if(n^s || w^e){
      |               ^
a.cc:19:17: error: 'e' was not declared in this scope
   19 |     if(n^s || w^e){
      |                 ^