Dinner
问题 : Dinner
时间限制: 1 Sec 内存限制: 32 MB
题目描述
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 chopsticks 2 bowl letter
样例输出
fork chopsticks bowl
提示
The tableware only contains: bowl, knife, fork and chopsticks.
解题思路
水题!没有什么好说的,直接寻找就可以了。
#include <stdio.h>
#include <string.h>
char tab[4][15]={"bowl", "knife", "fork", "chopsticks"};
int main()
{
int n;
char str[20];
while (~scanf("%d%*c", &n))
{
while (n--)
{
scanf("%s", str);
for (int i = 0; i < 4; i++)
{
if (!strcmp(str, tab[i]))
printf("%s ", str);
}
}
puts("");
}
return 0;
}Dinner的更多相关文章
- nyoj 218 Dinner(贪心专题)
Dinner 时间限制:100 ms | 内存限制:65535 KB 难度:1 描述 Little A is one member of ACM team. He had just won t ...
- Codeforces Educational Codeforces Round 5 B. Dinner with Emma 暴力
B. Dinner with Emma 题目连接: http://www.codeforces.com/contest/616/problem/A Description Jack decides t ...
- Codeforces Gym 100342D Problem D. Dinner Problem Dp+高精度
Problem D. Dinner ProblemTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/1003 ...
- nyoj 218 Dinner
Dinner 时间限制:100 ms | 内存限制:65535 KB 难度:1 描述 Little A is one member of ACM team. He had just won t ...
- 网络流(最大流)CodeForces 512C:Fox And Dinner
Fox Ciel is participating in a party in Prime Kingdom. There are n foxes there (include Fox Ciel). T ...
- UVA - 10249 The Grand Dinner
Description Problem D The Grand Dinner Input: standard input Output: standard output Time Limit: 15 ...
- NBUT 1217 Dinner
[1217] Dinner 时间限制: 1000 ms 内存限制: 32768 K 问题描写叙述 Little A is one member of ACM team. He had just won ...
- nyoj Dinner
Dinner 时间限制:100 ms | 内存限制:65535 KB 难度:1 描述 Little A is one member of ACM team. He had just won t ...
- Codeforces Round #290 (Div. 2) E. Fox And Dinner 网络流建模
E. Fox And Dinner time limit per test 2 seconds memory limit per test 256 megabytes input standard i ...
随机推荐
- Python Tornado简介
简介 Tornado 是 FriendFeed 使用的可扩展的非阻塞式 web 服务器及其相关工具的开源版本.这个 Web 框架看起来有些像web.py 或者 Google 的 webapp,不过为了 ...
- Kotlin中构造方法的参数var val 和 什么都没有的区别
1.什么都没有,在该类中使不能使用的, 这个参数的作用就是,传递给父类的构造方法 2.使用var 可以在类中使用,相当于 我们声明了一个该类中定义了一个private 的成员变量 3.val表示不让修 ...
- HDU 4857 逃生(拓扑排序)
拓扑排序 一.定义 对一个有向无环图(Directed Acyclic Graph简称DAG)G进行拓扑排序,是将G中所有顶点排成一个线性序列,使得图中任意一对顶点u和v,若<u,v> ∈ ...
- LightOJ - 1245 Harmonic Number (II) 求同值区间的和
题目大意:对下列代码进行优化 long long H( int n ) { long long res = 0; for( int i = 1; i <= n; i++ ) ...
- 生产者消费者模型java
马士兵老师的生产者消费者模型,我感觉理解了生产者消费者模型,基本懂了一半多线程. public class ProducerConsumer { public static void main(Str ...
- linux 安装图行界面
centos6的环境中 代码:[root@ebs122 sysconfig]#yum groupinstall "Desktop" 使用 init 5命令进入图形化界面,如果成功的 ...
- Oracle 服务器运行健康状况监控利器 Spotlight on Oracle 的安装与使用
1.使用教程;https://blog.csdn.net/defonds/article/details/52936664 2.下载链接:https://pan.baidu.com/s/1cn7tE_ ...
- [转] Understanding-LSTMs 理解LSTM
图文并茂,讲得极清晰. 原文:http://colah.github.io/posts/2015-08-Understanding-LSTMs/ colah's blog Blog About Con ...
- Unique Morse Code Words
Algorithm [leetcode]Unique Morse Code Words https://leetcode.com/problems/unique-morse-code-words/ 1 ...
- Keepalived详解(五):Keepalived集群中MASTER和BACKUP角色选举策略【转】
一.Keepalived集群中MASTER和BACKUP角色选举策略 在keepalived集群中,其实并没有严格意义上的主.备节点,虽然可以在keepalived配置文件中设置state选项为MAS ...