Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
82365 刘慕莀 31单词的长度 C++ Compile Error 0 MS 0 KB 261 2024-07-13 11:02:50

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ string s; getline(cin,s); int len=s.size(); int k=0; for(int i=0;i<len;i++){ if(s[i]!=' '){ k++ }else if(a[i]==' '){ if(k!=0){ cout<<k<<' '; k=0; } } cout<<k; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:11:1: error: expected ';' before '}' token
 }else if(a[i]==' '){
 ^
Main.cc:11:10: error: 'a' was not declared in this scope
 }else if(a[i]==' '){
          ^
Main.cc:19:1: error: expected '}' at end of input
 }
 ^