1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
#include <cstdio> #include <cstdlib> #include <algorithm> #include <string> using namespace std; bool S, E, N, W; string s; int () { ios::sync_with_stdio(false); cin.tie(0); cin >> s; for (register int i = 0; i < s.length(); i++) { if (s[i] == 'S') S = 1; if (s[i] == 'E') E = 1; if (s[i] == 'N') N = 1; if (s[i] == 'W') W = 1; } if ((S ^ N) || (E ^ W)) puts ("No"); else puts ("Yes"); return 0; }
|
近期评论