Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
125087 李昊宇 单词的长度 C++ Accepted 1 MS 272 KB 302 2025-07-13 11:54:16

Tests(5/5):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ char a[1000]; int b=0; cin.getline(a,1000); for(int i=0;i<strlen(a);i++){ b++; if(a[i]==' '){ b-=1; if(b>0){ cout<<b<<","; b=0; } } } cout<<b; return 0; }