Run ID:151301
提交时间:2026-04-11 16:14:12
#include<bits/stdc++.h> using namespace std; int main(){ // char c; // string s; // while(cin>>c>>s){ // char tar=tolower(c); // int cnt=0; // int len=s.size(); // for(char ch : s){ // if(tolower(ch)==tar){ // cnt++; // } // } // double p=1.0*cnt/len; // printf("%.5f\n",p); // } unordered_set<string> ware{"bowl","knife","fork","chopstick"}; int N; while(cin>>N){ string s; for(int i=0;i<N;++i){ cin>>s; if(ware.count(s)){ cout<<s<<" "; } } cout<<endl; } return 0; }