Dinner

时间限制:100 ms  |  内存限制:65535 KB
难度:1
 
描述
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.
来源
辽宁省10年省赛


字符串匹配函数  strcmp(*a,*b)  if(true) return 0;
自信
#include<stdio.h>
#include<string.h>
int main()
{
int n,i;
char a[]="bowl",b[]="knife",c[]="fork",d[]="chopsticks";
char e[];
while(scanf("%d",&n)==)
{
for(i=;i<n;i++)
{
scanf("%s",e);
if(strcmp(a,e)==)
printf("%s ",e);
if(strcmp(b,e)==)
printf("%s ",e);
if(strcmp(c,e)==)
printf("%s ",e);
if(strcmp(d,e)==)
printf("%s ",e); }
printf("\n");
}
return ;
}

nyoj 218 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. [ACM]51nod 贪心专题

    目录 A 低买高卖 C 接水问题 D做任务一 E做任务三 51nod一个贪心专题,大多数都是见过的套路,做题找找感觉,有些题解思路懒得写了,直接贴毕姥爷的直播题解了 A 低买高卖 考虑股票市场,一共有 ...

  3. nyoj 106背包问题(贪心专题)

    背包问题 时间限制:3000 ms  |  内存限制:65535 KB 难度:3   描述 现在有很多物品(它们是可以分割的),我们知道它们每个物品的单位重量的价值v和重量w(1<=v,w< ...

  4. nyoj 448 寻找最大数(贪心专题)

    寻找最大数 时间限制:1000 ms  |  内存限制:65535 KB 难度:2   描述 请在整数 n 中删除m个数字, 使得余下的数字按原次序组成的新数最大, 比如当n=920813467185 ...

  5. nyoj 71 独木舟上的旅行(贪心专题)

    独木舟上的旅行 时间限制:3000 ms  |  内存限制:65535 KB 难度:2   描述 进行一次独木舟的旅行活动,独木舟可以在港口租到,并且之间没有区别.一条独木舟最多只能乘坐两个人,且乘客 ...

  6. nyoj 14 会场安排问题(贪心专题)java

    会场安排问题 时间限制:3000 ms  |  内存限制:65535 KB 难度:4   描述 学校的小礼堂每天都会有许多活动,有时间这些活动的计划时间会发生冲突,需要选择出一些活动进行举办.小刘的工 ...

  7. nyoj 14 会场安排问题(贪心专题)

    会场安排问题 时间限制:3000 ms  |  内存限制:65535 KB 难度:4   描述 学校的小礼堂每天都会有许多活动,有时间这些活动的计划时间会发生冲突,需要选择出一些活动进行举办.小刘的工 ...

  8. poj 1328 Radar Installation(nyoj 287 Radar):贪心

    点击打开链接 Radar Installation Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 43490   Accep ...

  9. HDU3183A Magic Lamp,和NYOJ最大的数一样

    A Magic Lamp Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Tot ...

随机推荐

  1. Windows Live Writer测试

    第一次使用Windows Live Writer,一堆问题,不知道是中国强大的局域网防火墙问题还是咋的,弄了半天. 1.C++的测试代码: int _tmain(int argc, _TCHAR* a ...

  2. Azure机器学习入门(一)

    我们开始深入学习Azure机器学习的基本原理并为您开启伟大的数据科学之门.Azure 机器学习的一个重要特征就是在构建预测分析方案时,它能够方便地将开发模式集成为可重复的工作流模式.这就使得Azure ...

  3. PHP代码重用与函数编写

    代码重用与函数编写 1.使用require()和include()函数 这两个函数的作用是将一个文件爱你载入到PHP脚本中,这样就可以直接调用这个文件中的方法.require()和include()几 ...

  4. Linux常用命令(二)

    2.2.其他权限管理命令 命令名称:chown 功能:更改文件目录或文件的所有者语法:chown[用户][文件或目录]命令名称:chgrp 功能:改变文件或目录的所属组语法:chgrp[用户][文件或 ...

  5. tagfield

  6. Redis从入门到精通之一:序篇

    Redis一直是我想好好研究的组件,但是之前受限于工作场景,没有真正意义的使用过.但是目前工作中,Redis作为主要的缓存组件来缓冲服务器的压力.所以,本序列主要结合实际工作中遇到的各种Redis的设 ...

  7. WPF之Binding

    Binding就是将数据源和目标联系起来,一般来说可以是将逻辑层对象和UI层的控件对象相关联. 有连接就有通道,就可以在通道上建立相应的验证等关卡来验证数据有效性,或是其它处理工作:同时它也支持对数据 ...

  8. LintCode-Longest Increasing Subsequence

    Given a sequence of integers, find the longest increasing subsequence (LIS). You code should return ...

  9. JS组件系列——Bootstrap寒冬暖身篇:弹出框和提示框效果以及代码展示

    前言:对于Web开发人员,弹出框和提示框的使用肯定不会陌生,比如常见的表格新增和编辑功能,一般常见的主要有两种处理方式:行内编辑和弹出框编辑.在增加用户体验方面,弹出框和提示框起着重要的作用,如果你的 ...

  10. Jquery揭秘系列:ajax原生js实现

    讲到ajax这个东西,我们要知道两个对象XMLHTTPRequest和ActiveXObject ,提供了对 HTTP 协议的完全的访问,包括做出 POST 和 HEAD 请求以及普通的 GET 请求 ...