Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
114036 | 张智博 | 31统计单词数 | C++ | Accepted | 1 MS | 296 KB | 288 | 2025-03-18 22:26:32 |
#include <bits/stdc++.h> using namespace std; int main() { string t; getline(cin, t); stringstream ss(t); string word; int word_count = 0; while (ss >> word) { word_count++; } cout << word_count << endl; return 0; }