| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 135875 | 田祥江 | 31统计单词数 | C++ | Compile Error | 0 MS | 0 KB | 290 | 2025-11-08 16:46:07 |
#include<bits/stdc++.h> using namespace std; int main(){ string a; getline(cin,a); int len=a.size(); int k=0; for(int i=0;i<len;i++){ if(a[i]!=' '){ k++; } if(a[i-1]==' '){ k++; } if(i==len-1&&s[i]!=' '){ k++; } } } cout<<k; return 0; }
Main.cc: In function 'int main()':
Main.cc:15:16: error: 's' was not declared in this scope
if(i==len-1&&s[i]!=' '){
^
Main.cc: At global scope:
Main.cc:20:2: error: 'cout' does not name a type
cout<