Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
69172 殷震博 31统计单词数 C++ Accepted 0 MS 296 KB 222 2024-03-30 22:47:13

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ string s; getline(cin,s); int y=s.size(); int w=0; for(int i=0;i<=y;i++){ if(s[i]==' ' && s[i-1]!=' '){ w++; } } cout<<w+1; return 0; }