问题 : 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的更多相关文章

  1. nyoj 218 Dinner(贪心专题)

    Dinner 时间限制:100 ms  |  内存限制:65535 KB 难度:1   描述 Little A is one member of ACM team. He had just won t ...

  2. 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 ...

  3. Codeforces Gym 100342D Problem D. Dinner Problem Dp+高精度

    Problem D. Dinner ProblemTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/1003 ...

  4. nyoj 218 Dinner

    Dinner 时间限制:100 ms  |  内存限制:65535 KB 难度:1   描述 Little A is one member of ACM team. He had just won t ...

  5. 网络流(最大流)CodeForces 512C:Fox And Dinner

    Fox Ciel is participating in a party in Prime Kingdom. There are n foxes there (include Fox Ciel). T ...

  6. UVA - 10249 The Grand Dinner

    Description Problem D The Grand Dinner Input: standard input Output: standard output Time Limit: 15 ...

  7. NBUT 1217 Dinner

    [1217] Dinner 时间限制: 1000 ms 内存限制: 32768 K 问题描写叙述 Little A is one member of ACM team. He had just won ...

  8. nyoj Dinner

    Dinner 时间限制:100 ms  |  内存限制:65535 KB 难度:1   描述 Little A is one member of ACM team. He had just won t ...

  9. 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 ...

随机推荐

  1. python 数据分析2

    本节概要 Numpy详解 安装 Numpy的安装已经不想多说..在确保pip或pip3的路径被添加到系统环境变量里面之后,就可以直接用下面语句进行安装. pip install numpy or pi ...

  2. Redis 深度历险

    学习资料 https://juejin.im/book/5afc2e5f6fb9a07a9b362527 包括下面几方面的内容 基础 应用 原理 集群 拓展 源码 to be done

  3. 使用AOP思想无侵入式申请权限,解决组件化中权限问题(一)

    首先介绍AspectJx使用 https://github.com/HujiangTechnology/gradle_plugin_android_aspectjx 在根项目的build.gradle ...

  4. C中的malloc/free与C++中的new/delete的用法与区别

    1.先介绍malloc/free的用法: 原型函数: void *malloc(long NumBytes); 该函数分配了NumBytes个字节的内容,分配的空间是堆空间 malloc()根据用户所 ...

  5. python,<一>读取文件open()

    在实际操作中,我们经常会读取文件,这个时候python为我们提供了一个open()的方法,供我们读取文件,通过help(open),我们可以获取open的方法 f.close()关闭读取 f.read ...

  6. android SeekBar设置背景无法被填充满的bug

    在做一个播放进度的时候,用到了SeekBar,调用布局如下: <SeekBar android:id="@+id/example_audio_bar" android:lay ...

  7. SQL Server - GO

    GO GO是批处理的标志,是一条或多条SQL语句的集合,SQL Server将批处理语句编译成一个可执行单元,此单元称为执行计划. GO语句把程序分成一个个代码块,即使一个代码块执行错误,它后面的代码 ...

  8. 编程基础 - 0x00008 的0x代表什么?

    总结: 二进制:0dXXXX 八进制:0XXXX 十六进制:0xXXXX ------------------------------- 1- 十六进制 以“0x”开始的数据表示16进制,计算机中每位 ...

  9. 2018 codejam kickstart H轮

    被第一题傻逼题卡了很久……好的我也是个傻逼 倒在了最后一题 本来以为小数据过了就能过大数据 结果下载了大数据 发现怎么输出了好多个零 调代码过程中超时了 结束后重新提交了一下 果然是不通过的 A 题目 ...

  10. Angular 创建组件

    创建组件 0 命令创建 1 创建组件 定义hello.component.ts组件 在app.module.ts中引用并添加到declarations声明中 在app.component.html中使 ...