| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 155783 | 李昱龙 | 31统计单词数 | C++ | Accepted | 1 MS | 288 KB | 384 | 2026-06-13 14:41:46 |
#include<bits/stdc++.h> using namespace std; int main() { string s; getline(cin, s); int cnt = 0; int a=s.size(); bool d=1; for (int i=0;i<a;i++){ if(s[i]!=' '){ if (d!=0){ cnt++; d=0; } } else{ d=1; } } cout<<cnt<<endl; return 0; }