题解 | #统计单词#
统计单词
https://www.nowcoder.com/practice/11c6e7c9987c4ab48f8cdd8834c27064
#include<iostream> #include<string.h> using namespace std; int main() { string s; while (cin >> s) { if (s[s.size() - 1] != '.')cout << s.size() << " "; else cout << s.size() - 1 << " "; } return 0; }