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. weblogic集群无法启动,提示java.lang.NumberFormatException

    我有两台weblogic9.2做的集群A,B,A是主服务器,B是受管服务器,后来通过脚本启动weblogic服务,A服务启动异常,经查后台的日志文件发现报错消息如下: WebLogic Server ...

  2. BZOJ 3747 POI2015 Kinoman

    因为上午没有准备够题目,结果发现写完这道题没题可写了QAQ 又因为这道题范围是100w,我写了发线段树,以为要T,上午就花了一个小时拼命卡常数 结果下午一交居然过了QAQ 我们考虑枚举L,求最大R使得 ...

  3. [topcoder]FlowerGarden

    1.此题很勉强算DP.找了半天网上思路,是个三层的循环,n^3.2.基本思路就是先找到在第一个位置的花.这样就双层遍历,找到所有和其他不冲突的花中最高的一个,然后放到结果的首位.然后去掉此花,继续使用 ...

  4. rand5()产生rand7()

    http://www.cnblogs.com/dwdxdy/archive/2012/07/28/2613135.html 利用rand5()产生rand7().rand5()产生1到5的整数,ran ...

  5. eclipse myeclipse zend studio 中去掉双引号中的斜体

    去windows/preferences 菜单里,选Web/JSP Files/Editor/Syntax Coloring 在右边选Attribute Values ,把Italic的钩去掉就好了.

  6. jsoi2014前两轮回眸

    今天从常州回来了,第二轮考得惨不忍睹 大概来总结一下前两轮: 第一轮是4个小时,3道题,一道网络流,一道环形DP,一道线段树 最后一道题ahoi的原题(传送bzoj1798),非常水的线段树,是个很好 ...

  7. linq .dbml转化成sql脚本

    public String ConvertDBMLToSqlScript(System.Data.Linq.DataContext DBContext)  {         String DBCon ...

  8. C#编程让Outlook乖乖交出帐户密码

    许多人习惯于让Outlook记住密码,收邮件时便不必每次都输入邮箱密码,一切让Outlook代劳.但时间一长,马虎的人会把自己的邮箱密码忘记,这样就无法重新设置或者登录Web界面收取邮件了.Outlo ...

  9. ehcache 分布式集群同步数据实例

    本文使用rmi方式,借鉴百度能搜到的文章,但是均不能做到数据同步,做了些改动完全没问题,更详细说明介绍百度即可.直奔主题,可运行的demo实例! 创建一个maven项目,配置pom pom.xml & ...

  10. acdream 小晴天老师系列——苹果大丰收(DP)

    小晴天老师系列——苹果大丰收 Problem Description 小晴天的后花园有好多好多的苹果树,某天,苹果大丰收~小晴天总共摘了M个苹果,我们假设苹果之间是不可分辨的. 为了保存苹果,小晴天买 ...