Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
50714 冯诚阳 晚餐 C++ Accepted 2 MS 276 KB 793 2023-07-12 16:13:27

Tests(1/1):


Code:

#include <iostream> #include <string> #include <algorithm> using namespace std; int main(){ int num; string s; while(scanf("%d",&num)!=EOF){ getchar(); for(int i = 0;i < num;i++){ cin>>s; getchar(); if(s=="bowl"){ cout<<"bowl"; } else if(s=="knife"){ cout<<"knife"; } else if(s=="fork"){ cout<<"fork"; } else if(s=="chopsticks"){ cout<<"chopsticks"; } else { continue; } if(i<num-1){ cout<<" "; }else{ cout<<endl; } } } }