Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
151302 陈棋 晚餐 C++ Accepted 1 MS 268 KB 540 2026-04-11 16:15:10

Tests(1/1):


Code:

#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","chopsticks"}; 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; }