We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
소스 코드
단어의 개수는 공백의 개수로 처리 가능
공백의 개수를 구하고, 앞 뒤 공백 여부에 따라서 답 계산
int cnt = 0, len = s.length(); for(int i = 0; i<len; ++i) { if(s[i] == ' ') ++cnt; } if(s[0] == ' ' && s[len-1] == ' ') { cnt += -1; }else if(s[0] != ' ' && s[len-1] != ' ') { cnt += 1; } cout << cnt;
The text was updated successfully, but these errors were encountered:
minsoo0715
No branches or pull requests
1152: 단어의 개수
소스 코드
아이디어
단어의 개수는 공백의 개수로 처리 가능
구현
공백의 개수를 구하고, 앞 뒤 공백 여부에 따라서 답 계산
The text was updated successfully, but these errors were encountered: