| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 161578 | 颜学俊逸 | 31统计单词数 | C++ | Accepted | 1 MS | 292 KB | 250 | 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; }