Run ID:132563

提交时间:2025-10-08 20:04:54

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ string s; getline(cin,s); int a=s.size,c=0,s=0; for(int i=0;i<=a-1;i++){ if(s[i]==' '&&c!=0){ c=0; s+=1; } else c++; } if(c>0) s+=1; cout<<s; return 0; }