Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
3431 | 莫业祁 | 31单词的长度 | C++ | Compile Error | 0 MS | 0 KB | 288 | 2024-06-08 09:58:24 |
# include<iostream> using namespace std; int main(){ string s1; cin>>s1; int n=s1.size; int s=0; for(int i=0;i<n;i++){ if(a[i]=" "){ cout<<s; cout<<","; s=0; } else s++; } return 0; }
Main.cc: In function 'int main()': Main.cc:7:14: error: cannot convert 'std::basic_string<_CharT, _Traits, _Alloc>::size, std::allocator >' from type 'std::basic_string::size_type (std::basic_string::)()const noexcept (true) {aka long unsigned int (std::basic_string::)()const noexcept (true)}' to type 'int' int n=s1.size; ^ Main.cc:10:12: error: 'a' was not declared in this scope if(a[i]=" "){ ^