Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
132562 黄枳润 31统计单词数 C++ Compile Error 0 MS 0 KB 501 2025-10-08 20:02:09

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(){ string s; getlin(cin,s); int a=s.size(),j=0,sum=0; for(int i=0;i<=a-1;i++){ if(j!=' '){ j+=1; } if(s[i]==' '&&j>0){ sum+=1; } } cout<<sum+1; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:9:17: error: 'getlin' was not declared in this scope
     getlin(cin,s);
                 ^