Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
3391 吴奕希 31单词的长度 C++ Wrong Answer 0 MS 248 KB 352 2024-06-02 13:07:58

Tests(0/5):


Code:

# include<iostream> using namespace std; int main(){ string a; int cnt=0, l, c=0; getline(cin, a); l = a.size(); for(int i = 0; i <= l; i++){ if(a[i]!=32)cnt++; else if(cnt>0){ if(c>0)cout<<","; cout<<cnt; cnt=0; c++; } } return 0; }


Run Info:

------Input------
Good morning.
------Answer-----
4,8
------Your output-----
4