Dinner
问题 : Dinner
时间限制: 1 Sec 内存限制: 32 MB
题目描述
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>
char tab[4][15]={"bowl", "knife", "fork", "chopsticks"};
int main()
{
int n;
char str[20];
while (~scanf("%d%*c", &n))
{
while (n--)
{
scanf("%s", str);
for (int i = 0; i < 4; i++)
{
if (!strcmp(str, tab[i]))
printf("%s ", str);
}
}
puts("");
}
return 0;
}Dinner的更多相关文章
- nyoj 218 Dinner(贪心专题)
Dinner 时间限制:100 ms | 内存限制:65535 KB 难度:1 描述 Little A is one member of ACM team. He had just won t ...
- Codeforces Educational Codeforces Round 5 B. Dinner with Emma 暴力
B. Dinner with Emma 题目连接: http://www.codeforces.com/contest/616/problem/A Description Jack decides t ...
- Codeforces Gym 100342D Problem D. Dinner Problem Dp+高精度
Problem D. Dinner ProblemTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/1003 ...
- nyoj 218 Dinner
Dinner 时间限制:100 ms | 内存限制:65535 KB 难度:1 描述 Little A is one member of ACM team. He had just won t ...
- 网络流(最大流)CodeForces 512C:Fox And Dinner
Fox Ciel is participating in a party in Prime Kingdom. There are n foxes there (include Fox Ciel). T ...
- UVA - 10249 The Grand Dinner
Description Problem D The Grand Dinner Input: standard input Output: standard output Time Limit: 15 ...
- NBUT 1217 Dinner
[1217] Dinner 时间限制: 1000 ms 内存限制: 32768 K 问题描写叙述 Little A is one member of ACM team. He had just won ...
- nyoj Dinner
Dinner 时间限制:100 ms | 内存限制:65535 KB 难度:1 描述 Little A is one member of ACM team. He had just won t ...
- Codeforces Round #290 (Div. 2) E. Fox And Dinner 网络流建模
E. Fox And Dinner time limit per test 2 seconds memory limit per test 256 megabytes input standard i ...
随机推荐
- 🍓 JRoll、React滑动删除 🍓
import React, { Component } from 'react'; import '../src/css/reset.css'; import '../src/css/delete.c ...
- WebLogic XMLDecoder反序列化漏洞复现
WebLogic XMLDecoder反序列化漏洞复现 参考链接: https://bbs.ichunqiu.com/thread-31171-1-1.html git clone https://g ...
- Android RecyclerView 瀑布流滑动到最后自动加载更多
mRecycleView.setOnScrollListener(new RecyclerView.OnScrollListener(){ //用来标记是否正在向最后一个滑动,既是否向下滑动 bool ...
- ubuntu14.04配置face_recognition环境
Github项目地址:https://github.com/MiChongGET/face_collection 环境搭建 1. 环境 ubuntu14.04 LTS python2.7 pip ...
- pythonの连接MySQL数据库
1.要确保开发环境中安装了pymsql,如果没有安装那么在控制台输入: pip3 install pymysql 安装完成后,打开编辑器: #!/usr/bin/env python import p ...
- axios请求接口的踩坑之路
1.跨域问题除了前端安装插件还需要后端php设置,设置如下 Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, ...
- $Django cookies与session--解决无连接无状态问题, session配置
session作用: 会话保持,记住用户的登录状态(WEB网站,分布式架构) 作用(和cookie的区别) 避免了敏感信息保存在客户端,防止客户端修改cookie信息! -cookie:存储在客户端浏 ...
- $Django ajax简介 ajax简单数据交互,上传文件(form-data格式数据),Json数据格式交互
一.ajax 1 什么是ajax:异步的JavaScript和xml,跟后台交互,都用json 2 ajax干啥用的?前后端做数据交互: 3 之前学的跟后台做交互的方式: -第一种:在浏览器 ...
- MySQL--(了解)可能会用到的内置函数
mysql内置函数列表可以从mysql官方文档查询,这里仅分类简单介绍一些可能会用到的函数.1 数学函数abs(x)pi()mod(x,y)sqrt(x)ceil(x)或者ceiling(x)rand ...
- CSS集锦
div内容自动换行:word-wrap:break-word;word-break:break-all;