| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 82336 | 何思佳 | 31单词的长度 | C++ | Wrong Answer | 1 MS | 272 KB | 376 | 2024-07-13 10:47:57 |
#include<bits/stdc++.h> using namespace std; char s[1001]; int main() { int sum=0; cin.getline(s,1001); int len=strlen(s); int first=0; for(int i=0;i<=len+1;i++){ if(s[i]!=' '){ sum++; } else if(s[i]==' '&&first==0){ cout<<sum; sum=0; first++; } else if(s[i]==' '&&first!=0){ cout<<","<<sum; sum=0; } } return 0; }
------Input------
I will stare no effort to master a good command of advance XXX.
------Answer-----
1,4,5,2,6,2,6,1,4,7,2,7,4
------Your output-----
1,4,5,2,6,2,6,1,4,7,2,7