Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
125125 | 王金檐 | 单词的长度 | C++ | Compile Error | 0 MS | 0 KB | 268 | 2025-07-13 15:07:08 |
#include <iostream> #include <cstring> using namespace std; string s; int a[100]; int main(){ getline(cin,s); int n=s.size(); int k=0; for(int i=0;i<n;i++){ if(a[i]!=' '){ k++; }else if(s[i]==' '&&k!=0) cout<<k<<","; } } return 0; }
Main.cc:17:2: error: expected unqualified-id before 'return' return 0; ^ Main.cc:18:1: error: expected declaration before '}' token } ^