Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
7625 | 刘芃伽 | 单词的长度 | C++ | Wrong Answer | 0 MS | 264 KB | 384 | 2025-05-10 10:14:22 |
#include<bits/stdc++.h> using namespace std; int main(){ char a[1010]={}; cin.getline(a,1000); int cnt=0,n; n=strlen(a); for(int i=0;i<n;i++){ if(a[i]!=' ') cnt++; else{ if(cnt==0){ cout<<cnt<<','; cnt=0; } } } if(cnt!=0) cout<<cnt; return 0; }
------Input------
Good morning.
------Answer-----
4,8
------Your output-----
12