| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 161563 | 颜学俊逸 | 31单词的长度 | C++ | Accepted | 1 MS | 276 KB | 362 | 2026-10-06 10:53:32 |
#include<bits/stdc++.h> using namespace std; string s; int main() { getline(cin,s); s = s + " "; int len = s.size(),cnt = 0,f = 0; for(int i = 0;i < len;i++){ if(s[i]!=' '){ cnt++; }else{ if(cnt > 0){ if(f == 0){ cout << cnt; f = 1; }else{ cout << "," << cnt; } } cnt = 0; } } return 0; }