Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
158673 林睿 晚餐 C++ Accepted 2 MS 272 KB 534 2026-08-22 16:30:41

Tests(1/1):


Code:

#include <iostream> #include <string> using namespace std; int main() { int N; while (cin >> N) { bool first = true; for (int i = 0; i < N; i++) { string s; cin >> s; if (s == "bowl" || s == "knife" || s == "fork" || s == "chopsticks") { if (!first) cout << " "; cout << s; first = false; } } cout << endl; } return 0; }