Run ID:118119
提交时间:2025-04-23 21:39:22
#include <iostream> #include <string> using namespace std; int main() { string s1 = "bowl"; string s2 = "knife"; string s3 = "fork"; string s4 = "chopsticks"; int n; while(cin >> n) { string s; for(int i = 0; i < n; ++i) { cin >> s; if(s == s1 || s == s2 || s == s3 || s == s4) cout << s << ' '; } cout << endl; } return 0; }