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.
#include<stdio.h>
#include<string.h>
int main()
{
int n,m,j,i,sum;
char s[110][1100];
char a[4][15]={"bowl","knife","fork","chopsticks"};
while(scanf("%d",&n)!=EOF)
{
for(i=0;i<n;i++)
{
scanf("%s",s[i]);
}
for(i=0;i<n;i++)
{
for(j=0;j<4;j++)
{
if(strcmp(s[i],a[j])==0)
{
printf("%s ",a[j]); }
}
}
printf("\n");
}
return 0;
}

  

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. nyoj Dinner

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

  3. NYOJ 1007

    在博客NYOJ 998 中已经写过计算欧拉函数的三种方法,这里不再赘述. 本题也是对欧拉函数的应用的考查,不过考查了另外一个数论基本定理:如何用欧拉函数求小于n且与n互质所有的正整数的和. 记eule ...

  4. NYOJ 998

    这道题是欧拉函数的使用,这里简要介绍下欧拉函数. 欧拉函数定义为:对于正整数n,欧拉函数是指不超过n且与n互质的正整数的个数. 欧拉函数的性质:1.设n = p1a1p2a2p3a3p4a4...pk ...

  5. Android Weekly Notes Issue #218

    Android Weekly Issue #218 August 14th, 2016 http://androidweekly.net/issues/issue-218 ARTICLES & ...

  6. NYOJ 333

    http://www.cppblog.com/RyanWang/archive/2009/07/19/90512.aspx?opt=admin 欧拉函数 E(x)表示比x小的且与x互质的正整数的个数. ...

  7. NYOJ 99单词拼接(有向图的欧拉(回)路)

    /* NYOJ 99单词拼接: 思路:欧拉回路或者欧拉路的搜索! 注意:是有向图的!不要当成无向图,否则在在搜索之前的判断中因为判断有无导致不必要的搜索,以致TLE! 有向图的欧拉路:abs(In[i ...

  8. nyoj 10 skiing 搜索+动归

    整整两天了,都打不开网页,是不是我提交的次数太多了? nyoj 10: #include<stdio.h> #include<string.h> ][],b[][]; int ...

  9. 简答哈希实现 (nyoj 138 找球号2)

    例题链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=138 代码目的:复习哈希用 代码实现: #include "stdio.h&qu ...

随机推荐

  1. http://jingyan.baidu.com/article/a3761b2b66fe141577f9aa51.html

    http://jingyan.baidu.com/article/a3761b2b66fe141577f9aa51.html

  2. DSP\BIOS调试Heaps are enabled,but not set correctly

    转自:http://blog.sina.com.cn/s/blog_735f291001015t9i.html Heaps are enabled, but the segment for DSP/B ...

  3. 在Vim里使用gtags-cscope

    用Vundle安装好gtags-cscope后,要在vimrc里添加如下设置: " cscopeset cscopetag                  " 使用 cscope ...

  4. .NET中各种不同的Timer之间区别

    System.Timer.Timer 根据命名空间看这个类貌似才是标准的Timer,它提供Interval属性和Elapsed事件.可以每隔一个时间周期触发一次Elapsed事件.在ThreadPoo ...

  5. kali获得已经安装的软件列表

    有人说是用dpkg -l ,也有说是用dpkg --get-selections. debian:~# dpkg -l|grep install|wc -l2678debian:~# dpkg --g ...

  6. poj 2109 Power of Cryptography (double 精度)

    题目:http://poj.org/problem?id=2109 题意:求一个整数k,使得k满足kn=p. 思路:exp()用来计算以e为底的x次方值,即ex值,然后将结果返回.log是自然对数,就 ...

  7. Entityframework常用命令

    Enable-Migrations 启用Migration数据迁移 Add-Migration migrationname 添加一个migration Update-Database –TargetM ...

  8. apache开源项目--Jackrabbit

    Apache Jackrabbit 是由 Apache Foundation 提供的 JSR-170 的开放源码实现.. 随着内容管理应用程序的日益普及,对用于内容仓库的普通.标准化 API 的需求已 ...

  9. IE下设置unselectable与onselectstart属性的bug,Firefox与Chrome下的解决方案

    在IE下给DIV设置unselectable与onselectstart属性,可以让div的内容不能选中,这个功能在很多情况下,非常有用,但是他的bug太明显, 直接使用一个DIV是可以的,比如: & ...

  10. android ListView注意事项

    所有问题,都是自己遇到过的. 但内容,有一半是自己写的,也有一半是复制过来. 所以,写成原创还请原谅 1. ListView添加标题后(addHeader())后,使用listView.getAdap ...