nyoj--218--Dinner(语法)
2024-09-01 23:19:07
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年省赛
- 上传者
#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;
}
最新文章
- The Solution of UESTC 2016 Summer Training #1 Div.2 Problem A
- 自定义圆饼(利用贝塞尔曲线和CGContext类完成)
- 转:android异步任务设计思详解(AsyncTask)
- Javascript跨域问题总结
- 前端 解决swiper js 手动滑动一下后不能自动播放
- web工程导入MyEclipse 就变成Java工程 ———— 解决方案
- c&; c++ enum
- maven搭建个人仓库
- nexus私服安装
- 【bzoj1031】[JSOI2007]字符加密Cipher
- 201521123114 《Java程序设计》第13周学习总结
- sql经典试题
- 【原】无脑操作:TypeScript环境搭建
- Centos7安装InfluxDB1.7
- Python&#160;一键拉取Git分支源码自动解析并执行SQL语句
- 简单备份mysql数据库
- sql 按字段指定值排序
- 使用T4模板调用Sqlserver链接生成自己的模板
- Entity Framework管理实体关系(二):管理一对二关系
- iOS: 删除真机测试的Provisioning Profile后,在Code Singing中出现entitlements.plist文件无效,解决办法如下: