| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 132539 | 黄枳润 | 31单词的长度 | C++ | Accepted | 1 MS | 276 KB | 487 | 2025-10-08 19:33:55 |
#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 len=s.size(); int k=0; for (int i=0;i<len;i++){ if(s[i]!=' '){ k++; } else if(s[i]==' '){ if(k!=0){ cout<<k<<','; k=0; } } } cout<<k; return 0; }