nyoj 218 Dinner
Dinner
- 描述
- 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的更多相关文章
- nyoj 218 Dinner(贪心专题)
Dinner 时间限制:100 ms | 内存限制:65535 KB 难度:1 描述 Little A is one member of ACM team. He had just won t ...
- nyoj Dinner
Dinner 时间限制:100 ms | 内存限制:65535 KB 难度:1 描述 Little A is one member of ACM team. He had just won t ...
- NYOJ 1007
在博客NYOJ 998 中已经写过计算欧拉函数的三种方法,这里不再赘述. 本题也是对欧拉函数的应用的考查,不过考查了另外一个数论基本定理:如何用欧拉函数求小于n且与n互质所有的正整数的和. 记eule ...
- NYOJ 998
这道题是欧拉函数的使用,这里简要介绍下欧拉函数. 欧拉函数定义为:对于正整数n,欧拉函数是指不超过n且与n互质的正整数的个数. 欧拉函数的性质:1.设n = p1a1p2a2p3a3p4a4...pk ...
- Android Weekly Notes Issue #218
Android Weekly Issue #218 August 14th, 2016 http://androidweekly.net/issues/issue-218 ARTICLES & ...
- NYOJ 333
http://www.cppblog.com/RyanWang/archive/2009/07/19/90512.aspx?opt=admin 欧拉函数 E(x)表示比x小的且与x互质的正整数的个数. ...
- NYOJ 99单词拼接(有向图的欧拉(回)路)
/* NYOJ 99单词拼接: 思路:欧拉回路或者欧拉路的搜索! 注意:是有向图的!不要当成无向图,否则在在搜索之前的判断中因为判断有无导致不必要的搜索,以致TLE! 有向图的欧拉路:abs(In[i ...
- nyoj 10 skiing 搜索+动归
整整两天了,都打不开网页,是不是我提交的次数太多了? nyoj 10: #include<stdio.h> #include<string.h> ][],b[][]; int ...
- 简答哈希实现 (nyoj 138 找球号2)
例题链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=138 代码目的:复习哈希用 代码实现: #include "stdio.h&qu ...
随机推荐
- SaaS系列介绍之五: 我国SaaS市场分析
1 我国SaaS市场现状 我国SaaS从ASP年代发展到今天,也有不少时间了.我国是个十几亿人的大国,国情复杂,各地贫富不均,发展不平衡.信息系统建设也是各树一帜,各地为王.特别是占有大量用户的中小企 ...
- 隐马尔科夫模型 介绍 HMM python代码
#HMM Forward algorithm #input Matrix A,B vector pi import numpy as np A=np.array([[0.5,0.2,0.3],[0.3 ...
- PHP 如何阻止用户上传成人照片或者裸照
在这份教程中,我们将会学习到如何阻止用户通过PHP上传成人照片或者裸照. 示例 下载 我在phpclasses.org上面偶然发现一个很有用的,由Bakr Alsharif开发的可以帮助开发者基于 ...
- php修改排序,上移下移
php修改排序,上移下移 /** $UpDown //移动方向,up或down $table //表名 $id //当前移动的ID $id_col //ID字段的名称 $ ...
- 过虑器 ThreadLocal 权限 监听器 观察者模式
数据的压缩 GzipOutputStream - > > ByteArrayOutputStream. 以下是在某个servlet中对指定的数据进行压缩 package cn.itcast ...
- poj 3041 Asteroids (二分图的最大匹配 第一题)
题目:http://poj.org/problem?id=3041 题意:在某个n*n的空间内,分布有一些小行星,某人在里面打炮,放一枪后某一行或某一列的行星就都没了,让求最少的打炮数. 然后把每行x ...
- 函数buf_LRU_get_free_block
/******************************************************************//** Returns a free block from th ...
- bzoj1293
简易贪心+heap 注意要用链表 type link=^node; node=record loc:longint; next:link; end; ...
- [原]Unity3D深入浅出 - 新版粒子系统 (Shuriken)
Shuriken粒子系统是继Unity3.5版本之后推出的新版粒子系统,它采用了模块化管理,个性化的粒子模块配合粒子曲线编辑器使用户更容易创作出各种兵分复杂的粒子效果. 创建一个粒子系统的方式有两种: ...
- Sencha touch Panel之间的跳转(如不使用TabPanel或者Carousel控件而产生跳转的动画效果)
常规的Sencha touch 应用都是"header content footer"结构,这样的结构无疑将使用TabPanel来实现,而且TabPanel肯定是card布局,这样 ...