dinner
来源:互联网 发布:sqlserver中的in的用法 编辑:程序博客网 时间:2024/06/09 22:49
Dinner
时间限制:100 ms | 内存限制:65535 KB
难度:1
- 描述
- Little A is one member of ACM team. He had just won the gold in World Final. To celebrate, he decided to invite all to have one meal. As bowl, knife and other tableware is not enough in the kitchen, Little A goes to take backup tableware in warehouse. There are many boxes in warehouse, one box contains only one thing, and each box is marked by the name of things inside it. For example, if "basketball" is written on the box, which means the box contains only basketball. With these marks, Little A wants to find out the tableware easily. So, the problem for you is to help him, find out all the tableware from all boxes in the warehouse.
- 输入
- There are many test cases. Each case contains one line, and one integer N at the first, N indicates that there are N boxes in the warehouse. Then N strings follow, each string is one name written on the box.
- 输出
- For each test of the input, output all the name of tableware.
- 样例输入
3 basketball fork chopsticks2 bowl letter
- 样例输出
fork chopsticksbowl
解题思路:
其实本题只要能读懂题意就行,大意就是输入中的单词若是餐桌用具就输出即可
可以将每个单词用字符串读入,再用strcmp(a,b)==0语句比较,该语句成立,就输出即可。
程序代码:
#include<stdio.h>#include<string.h>int main(){int n;char a[20];while(scanf("%d",&n)!=EOF){for(int i=0;i<n;i++){scanf("%s",a);if(strcmp(a,"bowl")==0||strcmp(a,"knife")==0||strcmp(a,"fork")==0||strcmp(a,"chopsticks")==0)printf("%s ",a);}printf("\n");}}
0 0
- Dinner
- Dinner
- Dinner
- Dinner
- Dinner
- Dinner
- Dinner
- dinner
- Dinner
- Dinner
- Dinner
- Dinner
- Dinner
- Dinner
- Dinner
- Dinner
- frozen dinner
- 1052: Dinner
- 使用HttpClient登陆网站 抓取页面数据
- hdu1879——继续畅通工程——————【kruskal模板】
- ZooKeeper介绍及典型使用场景
- java、C语言中default
- swift or oc?
- dinner
- 转场动画中的私有type,非常炫酷
- 中遇到的一些warnings及其解决方法
- Android关于EditText,插入字符串到光标所在位置
- 一个简单的hibernate连接oracle数据库例子
- OpenCV学习(十六)之直方图均衡化并画出直方图
- 在linux上像查MSDN一样查man文档
- Qt中Ui名字空间以及setupUi函数的原理和实现
- 应该是文件路径里面的"\",全都需要换成"\\"才能正常用的。