Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
120925 刘珩宇 31单词的长度 C++ Accepted 1 MS 280 KB 461 2025-06-01 19:27:34

Tests(5/5):


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(){ int i=0,x,n=0; string a; getline(cin,a); x=a.size(); for(i=0;i<x;i++){ if(a[i]!=' '){ n++; } else if(a[i]==' '){ cout<<n<<","; n=0; } } cout<<n; return 0; }