Run ID:161578

提交时间:2026-10-06 11:12:37

#include<bits/stdc++.h> using namespace std; string s; int main() { getline(cin,s); s= s + " "; int len = s.size(),cnt = 0; for(int i = 0;i < len;i++){ if(s[i]== ' ' && s[i - 1] != ' '){ cnt++; } } cout << cnt; return 0; }