Submission #844418


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
int main() {
	string str;
	cin >> str;
	int x = 0, y = 0;
	for (int unsigned i = 0; i < s.size(); i++) {
		if (s[i] == 'S') y++;
		if (s[i] == 'N') y--;
		if (s[i] == 'W') x++;
		if (s[i] == 'E') x--;
	}
	if (x == 0 && y == 0) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	return 0;
}

Submission Info

Submission Time
Task A - Wanna go back home
User ugwis
Language C++14 (GCC 5.4.1)
Score 0
Code Size 369 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:7:31: error: ‘s’ was not declared in this scope
  for (int unsigned i = 0; i < s.size(); i++) {
                               ^