| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 132553 | 黄枳润 | 31统计单词数 | C++ | Compile Error | 0 MS | 0 KB | 433 | 2025-10-08 19:55:05 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ string s; int a=s.size()sum=0; for(int i=0;i<=a-1;i++){ if(s[i]==' '&&s[i+1]!=' '){ sum+=1; } } cout<<sum+1; return 0; }
Main.cc: In function 'int main()':
Main.cc:9:19: error: expected ',' or ';' before 'sum'
int a=s.size()sum=0;
^
Main.cc:12:13: error: 'sum' was not declared in this scope
sum+=1;
^
Main.cc:15:11: error: 'sum' was not declared in this scope
cout<