问题 : 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 爬虫三 beautifulsoup模块

    beautifulsoup模块 BeautifulSoup模块 BeautifulSoup是一个模块,该模块用于接收一个HTML或XML字符串,然后将其进行格式化,之后遍可以使用他提供的方法进行快速查 ...

  2. react-踩坑记录——swiper报错!

    已经在html文件中使用过,正确无误:但做成组件后(各种依赖文件引入路径确认无误)报错. 在只引入swiper.css时未报错,引入swiper.js文件后报错,如下: 错误原因,不详. 解决措施,不 ...

  3. 在IntelliJ IDEA 中配置Ueditor富文本插件

    这是我自学的配置教程,刚刚学习不太完善请谅解! 我会根据我的学习进程对此进行更贴,欢迎关注哦 ! 第一步:下载插件,地址:http://ueditor.baidu.com/website/downlo ...

  4. nmap 使用总结

    nmap 网络探测工具 参考链接: https://nmap.org/man/zh/ http://www.360doc.com/content/18/0127/18/52402560_7255744 ...

  5. Java内存模型-final域的内存语义--没明白,预留以后继续理解

    https://www.cnblogs.com/yuanfy008/p/9349275.html 来自 Java并发编程(1)-Java内存模型

  6. requirements.txt文件教程

    方法有2种,命令都是一样,只是执行地方不一样 此方法主要用于迁移新环境使用,为防止代码出现问题,最好使用原装库,所以就有了迁移代码和库的操作 第一种:在pycharm中,左下角有个双重正方形,点击里面 ...

  7. Django中的信号基础知识

    Django中提供了“信号调度”,用于在框架执行操作时解耦.通俗来讲,就是一些动作发生的时候,信号允许特定的发送者去提醒一些接受者. 1.Django内置信号 1 2 3 4 5 6 7 8 9 10 ...

  8. C#如何操作XML文件

    ⒈XML? XML是一种可扩展的标记语言 具有以下特点 1.严格区分大小写 2.标签成对出现 3.有且只有一个根节点 ⒉XML的创建 <?xml version="1.0" ...

  9. 【ARTS】01_19_左耳听风-20190318~20190324

    ARTS: Algrothm: leetcode算法题目 Review: 阅读并且点评一篇英文技术文章 Tip/Techni: 学习一个技术技巧 Share: 分享一篇有观点和思考的技术文章 Algo ...

  10. A Light CNN for Deep Face Representation with Noisy Labels

    承接上一篇博客.该论文思路清晰,实验充分,这里大致写一些比较不错的idea.从标题就能看出本文的主要贡献:轻量.鲁棒.利用一个轻量CNN从大规模数据且含大量噪声中来学习一个深度面部表征. 直接谈谈贡献 ...