标签:
3 basketball fork chopsticks 2 bowl letter
fork chopsticks bowl
1 #include <stdio.h> 2 #include <string.h> 3 int main(void){ 4 int N,flag; char s[100]; 5 char dis[][11]={"bowl", "knife", "fork", "chopsticks"}; 6 while(scanf("%d",&N) != EOF){ 7 flag = 0;///控制空格的输出 8 while(N--){ 9 scanf("%s",s); 10 for(int i = 0; i < 4; i++){ 11 if(strcmp(s,dis[i]) == 0){ 12 if(flag != 0) 13 printf(" "); 14 printf("%s",s); 15 flag = 1; 16 } 17 } 18 } 19 printf("\n"); 20 } 21 return 0; 22 }
标签:
原文地址:http://www.cnblogs.com/yfs123456/p/5669043.html