Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
2708 吴奕希 单词的长度 C++ Accepted 0 MS 268 KB 369 2024-01-20 18:30:49

Tests(5/5):


Code:

# include<iostream> # include<cstring> using namespace std; int main(){ char s[1000]; int n=0, n1=0; cin.getline(s, 1000); for(int i = 0; i < strlen(s); i++) { if(s[i]==' '){ cout<<n<<","; n=0; n1++; } else{ n++; } } cout<<n; return 0; }