标签:style io color ar os sp for div on
3 basketball fork chopsticks 2 bowl letter
fork chopsticks bowl
The tableware only contains: bowl, knife, fork and chopsticks.(根据该提示可以快速写出答案)
题目大意:Little A在比赛中获奖,准备和大家庆祝一番,结果发现自己的餐具不够,于是他去寻找餐具,我们的任务是从给出的物品中选出餐具(就是从给出的英文单词中选出要求的,提示中的四个bowl, knife, fork and chopsticks),读懂意思后,答案基本就出来了!
#include<stdio.h> #include<string.h> int main() { int n; char ch[15];//支持最长的字符串为15 while(scanf("%d",&n)!=EOF){ while(n--) { scanf("%s",ch); if(strcmp(ch,"bowl")==0)printf("%s ",ch); else if(strcmp(ch,"knife")==0)printf("%s ",ch); else if(strcmp(ch,"fork")==0)printf("%s ",ch); else if(strcmp(ch,"chopsticks")==0)printf("%s ",ch); } printf("\n"); } return 0; }
标签:style io color ar os sp for div on
原文地址:http://blog.csdn.net/u012437355/article/details/40920021