#include #include #include void main(void){ double x,y; char str[1000] = "a"; scanf("%s",str); for(int i = 0 ; i < (int)strlen(str) ; i++){ switch(str[i]){ case 'N': x ++; break; case 'E': y++; break; case 'W': y--; break; case 'S': x--; break; } } double ans = hypot(x,y); printf("%0.5f",ans); }