Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
113279 | 吴梓玄 | 31统计单词数 | C++ | Accepted | 1 MS | 272 KB | 234 | 2025-03-15 16:25:03 |
#include <bits/stdc++.h> using namespace std; int main() { char s[5005]; gets(s); int n=0; int m=strlen(s); for(int i=0;i<m;i++){ if (i==0 || s[i-1]==' ' && s[i]!=' '){ n=n+1; } } cout<<n; return 0; }