#include #include int main(void) { int i, x = 0, y = 0; char s[101]; scanf("%s", s); printf("%s\n", s); i = 0; while(s[i] != '\0'){ switch(s[i]){ case 'N': x--; break; case 'S': x++; break; case 'E': y++; break; case 'W': y--; break; } i++; } //printf("%d %d\n", x, y); printf("%f\n", sqrt(x * x + y * y)); return 0; }