问题 : 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. 下载最新的glibc库并临时使用,而不污染原有系统环境

    以下参考了文中提到的博文,那篇博文其中有他安装时报错的内容,以及如何解决的,特别是报错2,值得学习借鉴 另外升级glibc,这篇文章有补充https://blog.csdn.net/fzuzhangh ...

  2. L - LCM Walk HDU - 5584 (数论)

    题目链接: L - LCM Walk HDU - 5584 题目大意:首先是T组测试样例,然后给你x和y,这个指的是终点.然后问你有多少个起点能走到这个x和y.每一次走的规则是(m1,m2)到(m1+ ...

  3. Hibernate注解与JPA

    Hibernate注解与JPA - charming的专栏 - CSDN博客http://blog.csdn.net/zxc123e/article/details/51499652 之前记录的一些东 ...

  4. linux 权限管理

  5. openstack-----各种系统镜像制作

    本章内容     1.centos镜像制作 2.windows镜像制作 3.ubunt镜像制作 一.centos7镜像制作 1.检查系统是否支持kvm: egrep "(vmx|svm)&q ...

  6. SqlServer三种常用窗口函数

    插入数据 ,),(,),(,),(,),(,),(,),(,) ⒈rank()over,跳跃排序,允许并列,并在发生并列时保留名次空缺. select rank() over(order by sco ...

  7. k64 datasheet学习笔记35---Analog-to-Digital Converter (ADC)

    0.前言 本文主要介绍K64的ADC部分的特性,内部架构,信号描述及操作接口等 1.简介 1.1.ADC模块特性 线性逐次逼近算法,达16bit分辨率 达到4对差分和24个单端模拟量输入 输出模式 差 ...

  8. RTL8201EL介绍【转】

    转自:https://blog.csdn.net/Firefly_cjd/article/details/79826698 本文为博主原创文章,未经博主允许不得转载. https://blog.csd ...

  9. delphi 控件集

    delphi  控件集: 1)RAIZE 控件包  :http://www.raize.com/devtools/rzcomps/   被收购 Raize Components has been ac ...

  10. BCG界面库

    之前用过BCG界面库中的表格控件,深感其强大,现在再来用一下其它的. 一.   关于BCGControlBar. BCGControlBar是一个基于MFC的扩展库,您可以通过完全的用户化操作构成一些 ...