| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 74710 | 牛延希 | 单词的长度 | C++ | Compile Error | 0 MS | 0 KB | 388 | 2024-05-25 17:42:02 |
#include<iostream> #include<cstring> using namespace std; int main(){ bool b=0; int s=-1; char a[1145]; cin.getline(a,1145); for(int i=0;a[i]!='\0';i++){ if(a[i]!=' ' && b==0){ b=1; s++; }if(a[i]!=' ' && b){ s++;0. }if(a[i]==' ' && b && s){ b==0; cout<<s<<","; s=0; } }cout<<s; return 0; }
Main.cc: In function 'int main()':
Main.cc:17:5: error: expected ';' before '}' token
}if(a[i]==' ' && b && s){
^
Main.cc:17:5: warning: statement has no effect [-Wunused-value]
Main.cc:18:10: warning: statement has no effect [-Wunused-value]
b==0;
^