Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
100167 | Kevin | 晚餐 | C++ | Wrong Answer | 1 MS | 268 KB | 285 | 2024-12-06 14:43:12 |
#include<bits/stdc++.h> using namespace std; string s[100]; int main(){ int n; cin>>n; for(int i=1;i<=n;i++){ cin>>s[i]; } for(int i=1;i<=n;i++){ if((s[i]=="bowl")||(s[i]=="knife")||(s[i]=="fork")||(s[i]=="chopsticks")){ cout<<s[i]<<" "; } } return 0; }
------Input------
2 football bowl 5 meat toy paper pen fork 3 book chopsticks bowl 4 chopsticks bowl fork knife 6 bowl knife chopsticks fork toy book 1 fork 7 book toy football meat baseball cap fork 8 cap cloth paper meat fork bowl chopsticks toy 9 cap cloth paper meat fork bowl chopsticks toy book 10 cap cloth paper meat fork bowl chopsticks toy book pen
------Answer-----
bowl fork chopsticks bowl chopsticks bowl fork knife bowl knife chopsticks fork fork fork fork bowl chopsticks fork bowl chopsticks fork bowl chopsticks
------Your output-----
bowl