Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
152620 万嘉宇 单词的长度 C++ Compile Error 0 MS 0 KB 529 2026-04-28 20:08:14

Tests(0/0):


Code:

#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(){ char a[1000]; cin.getline(a,1000) int x=0; for(int i=0;i<=strlen(a);i++){ if(a[i]==' '&&a[i+1]!=' '){ cout<<x<<","; x=0; else if(a[i]!=' '){ x++; } } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:10:5: error: expected ';' before 'int'
     int x=0;
     ^
Main.cc:11:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<=strlen(a);i++){
                  ^
Main.cc:13:19: error: 'x' was not declared in this scope
             cout<