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.
- 来源
- 辽宁省10年省赛
- 上传者
#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(语法)的更多相关文章
- nyoj 218 Dinner(贪心专题)
Dinner 时间限制:100 ms | 内存限制:65535 KB 难度:1 描述 Little A is one member of ACM team. He had just won t ...
- 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 ...
- shell脚本语法基础汇总
shell脚本语法基础汇总 将命令的输出读入一个变量中,可以将它放入双引号中,即可保留空格和换行符(\n) out=$(cat text.txt) 输出1 2 3 out="$(cat te ...
- markdown的流程图实现和代码语法着色
用flowchart为markdown添加流程图 举个例子如下,根据这个例子大家就能看懂我到底是怎么实现的 <!DOCTYPE html> <html> <head> ...
- CSDN-markdown编辑器语法——字体、字号与颜色
Markdown是一种可以使用普通文本编辑器编写的标记语言,通过类似HTML的标记语法,它可以使普通文本内容具有一定的格式.但是它本身是不支持修改字体.字号与颜色等功能的! CSDN-markd ...
- linux base shell 基础语法2
转载 http://blog.csdn.net/aggrelxf/article/details/8263110 单引 双引 反引用[] [[]] 将命令的输出读入一个变量中,可以将它放入双引号中,即 ...
- MySQL中show语法使用总结
MySQL中 show 语法的使用: 先查看MySQL版本信息: mysql> select version(); +------------+ | version() | +--------- ...
- ES5与ES6常用语法教程之 ①函数写法、创建对象、导入导出模块方式
函数写法区别 计算a, b两个数字之和,有返回值 es5 写法 function add(a, b) { return a + b; } es6 写法(箭头函数) let add = (a, b) = ...
- Word中的代码怎样语法高亮
在平常我们粘贴代码到Word中的时候,经常会遇到代码粘贴到Word中后没有语法高亮,看着很乱很不友好,Word自带的样式---语法使用着也不尽人意, 网上有很多做法可以使得在插入在Word中的代码能够 ...
随机推荐
- ASP.NET-HttpPostedFileBase file为null的问题
MVC使用Ajax.BeginForm上传图片时HttpPostedFileBase file为null,Request.Files获取不到文件,问题分析是页面中存在jquery.unobtrusiv ...
- POI 导入excel数据自己主动封装成model对象--代码分析
上完代码后,对代码进行基本的分析: 1.主要使用反射api将数数据注入javabean对象 2.代码中的日志信息级别为debug级别 3.获取ExcelImport对象后须要调用init()方法初始化 ...
- poj1961--Period(KMP求最小循环节)
Period Time Limit: 3000MS Memory Limit: 30000K Total Submissions: 13511 Accepted: 6368 Descripti ...
- 《Head First 设计模式》学习笔记——适配器模式 + 外观模式
在ADO.NET中.对于我们从数据库中取出的数据都要放到一个DataSet中,无论你是Access的数据库,还是SQL的数据库,或者是Oracle的数据库都要放到DataSet中..NET中并没有提供 ...
- Android圆形图片--自己定义控件
Android圆形图片控件效果图例如以下: 代码例如以下: RoundImageView.java package com.dxd.roundimageview; import android.con ...
- MongoDB 系列(一) C# 类似EF语法简单封装
之前写过一篇关于MongoDB的封装 发现太过繁琐 于是打算从新写一篇简易版 1:关于MongoDB的安装请自行百度,进行权限认证的时候有一个小坑,3.0之后授权认证方式默认的SCRAM-SHA-1模 ...
- 字符串转换整数 (atoi) C++实现 java实现 leetcode系列(八)
字符串转换整数 (atoi) java实现 C++实现 请你来实现一个 atoi 函数,使其能将字符串转换成整数. 首先,该函数会根据需要丢弃无用的开头空格字符,直到寻找到第一个非空格的字符为止. 当 ...
- awesome python 中文版 相见恨晚!(pythonNB的第三方资源库)
Awesome Python中文版来啦! 原文链接:Python 资源大全 内容包括:Web框架.网络爬虫.网络内容提取.模板引擎.数据库.数据可视化.图片处理.文本处理.自然语言处理.机器学习.日志 ...
- 移动端1px细线问题
1可以用伪类实现 .con{position: relative;.con:before { content: " "; position: absolute; left: 0; ...
- PSSecurityException之PowerShell权限设置
Windows下PowerShell默认的权限级别是Restricted,不允许执行PS脚本(即.ps1文件).如果在Restricted权限级别下运行,会得到错误信息: .\XXXX.ps1 : F ...