#include <iostream>
#include <string>
using namespace std;
int main() {
string s;
int cnt = 0;
getline(cin, s);
for (int i = 0; i < s.length(); i++) {
if (s.at(i) == ' ') cnt++;
}
if (s.at(0) == ' ') cnt--;
if (s.at(s.length() - 1) == ' ') cnt--;
cout << cnt + 1;
}
'Algorithm ๐ง๐ปโ๐ป > ๋ฐฑ์ค(BOJ)' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค,c++] 1157๋ฒ - ๋จ์ด ๊ณต๋ถ (0) | 2021.10.28 |
---|---|
[๋ฐฑ์ค,c++] 11562๋ฒ - ๋ฐฑ์๋ก ๋ธ๋ ์ดํฌ (0) | 2021.10.28 |
[๋ฐฑ์ค,c++] 11557๋ฒ - Yangjojang of The Year (0) | 2021.10.28 |
[๋ฐฑ์ค,c++] 1149๋ฒ - RGB๊ฑฐ๋ฆฌ (0) | 2021.10.28 |
[๋ฐฑ์ค,c++] 11444๋ฒ - ํผ๋ณด๋์น์ 6 (0) | 2021.10.28 |
[๋ฐฑ์ค,c++] 11441๋ฒ - ํฉ ๊ตฌํ๊ธฐ (0) | 2021.10.27 |
๋๊ธ