Run ID:118120

提交时间: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; }