| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 163744 | 罗钰帆 | 单词的长度 | C++ | Accepted | 1 MS | 272 KB | 550 | 2026-10-29 19:44:39 |
#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(){ char a[100]; int b,cnt=0; cin.getline(a,100); b=strlen(a); for(int i=0;i<=b;i++){ if(a[i]!=' '){ cnt++; } else if(a[i+1]!=' '){ cout<<cnt<<','; cnt=0; } } cout<<cnt-1; return 0; }