| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 151025 | 翁思宸 | 31统计单词数 | C++ | Accepted | 1 MS | 284 KB | 340 | 2026-04-03 18:30:09 |
//1417 31统计单词数 #include<iostream> #include<cstdio> #include<cstring> #include<cmath> using namespace std; int main(){ string n; int a,s=1,l; getline(cin,n); l=n.length(); for(int i=0;i<l;i++){ if(n[i]==' ' && n[i+1]!=' '){ s++; } } cout<<s; return 0; }