Run ID:158673

提交时间:2026-08-22 16:30:41

#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; }