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年省赛
上传者

ACM_李如兵


#include <string>
#include <iostream>
using namespace std;
int main()
{
string a[101];
int n,i,j;
while(cin>>n)
{
for(i=0;i<n;i++)
{
cin>>a[i];
}
for(i=0;i<n;i++)
{
if(a[i]=="bowl"||a[i]=="knife"||a[i]=="fork"||a[i]=="chopsticks")
cout<<a[i]<<" ";
}
cout<<"\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 218 Dinner

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

  3. nyoj Dinner

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

  4. shell脚本语法基础汇总

    shell脚本语法基础汇总 将命令的输出读入一个变量中,可以将它放入双引号中,即可保留空格和换行符(\n) out=$(cat text.txt) 输出1 2 3 out="$(cat te ...

  5. markdown的流程图实现和代码语法着色

    用flowchart为markdown添加流程图 举个例子如下,根据这个例子大家就能看懂我到底是怎么实现的 <!DOCTYPE html> <html> <head> ...

  6. CSDN-markdown编辑器语法——字体、字号与颜色

     Markdown是一种可以使用普通文本编辑器编写的标记语言,通过类似HTML的标记语法,它可以使普通文本内容具有一定的格式.但是它本身是不支持修改字体.字号与颜色等功能的!   CSDN-markd ...

  7. linux base shell 基础语法2

    转载 http://blog.csdn.net/aggrelxf/article/details/8263110 单引 双引 反引用[] [[]] 将命令的输出读入一个变量中,可以将它放入双引号中,即 ...

  8. MySQL中show语法使用总结

    MySQL中 show 语法的使用: 先查看MySQL版本信息: mysql> select version(); +------------+ | version() | +--------- ...

  9. ES5与ES6常用语法教程之 ①函数写法、创建对象、导入导出模块方式

    函数写法区别 计算a, b两个数字之和,有返回值 es5 写法 function add(a, b) { return a + b; } es6 写法(箭头函数) let add = (a, b) = ...

  10. Word中的代码怎样语法高亮

    在平常我们粘贴代码到Word中的时候,经常会遇到代码粘贴到Word中后没有语法高亮,看着很乱很不友好,Word自带的样式---语法使用着也不尽人意, 网上有很多做法可以使得在插入在Word中的代码能够 ...

随机推荐

  1. Scratch单机版下载

    Scratch单机版下载 这两个地址速度比较快: Adobe Air:http://7dx.pc6.com/wwb5/AdobeAIR2800127.zip Scratch :http://7dx.p ...

  2. hdoj--3666--THE MATRIX PROBLEM(差分约束+SPFA深搜)

    THE MATRIX PROBLEM Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Other ...

  3. (一)Eureka 服务的注册与发现

    (一)服务的注册于发现(eureka); Eureka Server: 服务注册中心,负责服务列表的注册.维护和查询等功能 在Idea里,新建项目,选择Spring initializer. 下面的p ...

  4. HTTP报文头解析

    HTTP报文头解析 本篇博客我们就来详细的聊一下HTTP协议的常用头部字段,当然我们将其分为请求头和响应头进行阐述.下方是报文头每个字段的格式,首先是头部字段的名称,如Accept,冒号后方紧跟的是该 ...

  5. Android封装类似微信的顶部TitleBar弹出的PopupWindow代码

    Android仿微信顶部titlebar,点击加号弹出的PopupWindow,是封装好的PopupWindow,直接拿来用即可,先看效果图:  调用代码非常简单,这是MainActivity的代码: ...

  6. (转载)Android引导界面实现

    Android引导界面实现 Android   2014-07-10 14:47:36 发布 您的评价:       4.0   收藏     3收藏 ViewPager类提供了多界面切换的新效果,是 ...

  7. (转载) 百度地图工具类封装(包括定位,附近、城市、范围poi检索,反地理编码)

    目录视图 摘要视图 订阅 赠书 | 异步2周年,技术图书免费选      程序员8月书讯      项目管理+代码托管+文档协作,开发更流畅 百度地图工具类封装(包括定位,附近.城市.范围poi检索, ...

  8. windows下mysql解压版安装及centos下mysql root密码忘记

    windows安装 1. 下载zip版的解压后将bin添加到path. 2. 修改解压目录D:\mysql\mysql-5.7.12-winx64下的my.ini,设置路径: 还要添加 [client ...

  9. 通过curl获取网页访问时间

    curl -w %{time_namelookup}:%{time_connect}:%{time_starttransfer}:%{time_total}:%{speed_download}&quo ...

  10. 1044 - Access denied for user 'root'@'%' to database 'xahy-blog' 解决方案二

    检查 user 表中'root'@'%' 的grant的权限 select HOST,USER,Grant_priv,Super_priv from mysql.`user`; 可以看到现在这两个权限 ...