Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
118120 | 张智博 | 晚餐 | C++ | Accepted | 1 MS | 268 KB | 481 | 2025-04-23 21:42:41 |
#include <iostream> #include <string> using namespace std; int main() { int n; while (cin >> n) { string s; bool first = true; for (int i = 0; i < n; ++i) { cin >> s; if (s == "bowl" || s == "knife" || s == "fork" || s == "chopsticks") { if (!first) cout << " "; cout << s; first = false; } } cout << endl; } return 0; }