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 ...
随机推荐
- Javascript - ExtJs - 数据
数据(ExtJs Data) Ext.data命名空间 有关数据存储.读取的类都定义在Ext.data命名空间中.Ext的gridPanel.combobox的数据源都是来自Ext.data提供的类. ...
- 使用grep排除空行和注释行
grep的排除选项为 -v排除空行的命令是:grep -v '^$' filename排除以#注释的命令是:grep -v '^#' filename 结合起来就是,既排除空行又排除注释行的命令gre ...
- openstack Q版部署-----Mysql、MQ、Memcached安装配置(2)
一.安装mysql(contorller) 安装软件包: yum install -y mariadb mariadb-server python2-PyMySQL 配置my.cnf文件 vi /et ...
- Oracle 11g 的 自动内存管理
oracle11g 设置memory_target的值,开启AMM(Auto Memory Management),剩下的Oracle就可以自动维护了 参考:1.https://www.cnblogs ...
- MyBatis-进阶2
typeHandler typeHandler有什么用? 你可以重写类型处理器或创建你自己的类型处理器来处理不支持的或非标准的类型. 具体做法为:实现 org.apache.ibatis.type.T ...
- Java内存模型[转]
原文:http://www.cnblogs.com/nexiyi/p/java_memory_model_and_thread.html 1. 概述 多任务和高并发是衡量一台计算机处理器的能力重要指标 ...
- AD7729_双通道Sigma-Delta ADC
sigma-delta adc的原理,就是通过一种结构把量化噪声调制到频谱的高端,也即对量化噪声而言,sdm是一个高通滤波器,而对基带信号则等价为一个全通滤波器,这样等价的基带信号的量化噪声就很小了, ...
- XE7/X10.2 Datasnap使用 dbExpress 连接MySQL数据库
本人使用:DELPHI X10.2.2 版本连接 MYSQL 5.1 (安装 mysql-5.1.72-win32.msi)的32位版本,开始连接不了: 将 MYSQL 5.1 安装目录下bin 中的 ...
- sqlserver 导出数据
背景 一看到这个标题,还有这个内容,感觉当初记录这个知识点真是记录的太简单了.不过通过这个知识点我还真想起了当初的一些事情.写的题外话可能更有意思,希望每篇文章我都能加个当时的题外记录.当时一直搞or ...
- 制作ecc证书(linux命令行)
生成ECC证书.Debian:/home/test# openssl ecparam -out EccCA.key -name prime256v1 -genkeyDebian:/home/test# ...