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

解题分析: 在给出的一系列字符中找到属于餐具的单词

一段时间没有做题了,猛然间刷一道,还wr了两次,额,手生了

#include<stdio.h>
#include<string.h>int main(){char stemp[20];int i,j,n,k,m;while(scanf("%d",&n)!=EOF){k=0;for(i=0;i<n;i++){scanf("%s",stemp);if(strcmp(stemp,"bowl")==0){printf("bowl ");continue;}if(strcmp(stemp,"knife")==0){printf("knife ");continue;}if(strcmp(stemp,"fork")==0){printf("fork ");continue;}if(strcmp(stemp,"chopsticks")==0){printf("chopsticks ");continue;}}printf("\n");}return 0;} 

nyoj 218 dinner相关推荐

  1. 《贪心算法》— NYOJ 贪心算法题目汇总(一)

    题目6 题目信息 运行结果 本题排行 讨论区 喷水装置(一) 时间限制:3000 ms  |  内存限制:65535 KB 难度:3 描述 现有一块草坪,长为20米,宽为2米,要在横中心线上放置半径为 ...

  2. NYOJ 30 Gone Fishing JAVA+解析

    Gone Fishing这道题目运用的多次折合成一次这种思想我首次见,我想的一个思路是,每次算一下鱼量和时间代价比,这个代码我没有敲,下面的代码是一位仁兄敲得,我研读了一下,做了一个注释,应该有利于后 ...

  3. Manacher算法 , 实例 详解 . NYOJ 最长回文

    51 Nod http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1089 Manacher 算法 定义数组 p[i]表示以i为 ...

  4. NYOJ 527 AC_mm玩dota

    AC_mm玩dota 时间限制:1000 ms  |  内存限制:65535 KB 难度:2 描述 大家都知道AC_mm比较喜欢玩游戏,特别是擅长war3这款经典游戏.某天AC_mm来到了VS平台上 ...

  5. PhD representive Punting and Dinner Plan

    PhD representive Punting and Dinner Plan 文章目录 PhD representive Punting and Dinner Plan Time Location ...

  6. hdu-2204 Eddy's爱好 nyoj 526

    hdu : http://acm.hdu.edu.cn/showproblem.php?pid=2204 nyoj :  http://acm.nyist.net/JudgeOnline/proble ...

  7. NYOJ 762 第k个互质数(二分 + 容斥)

    第k个互质数 时间限制:1000 ms  |  内存限制:65535 KB 难度:4 描述 两个数的a,b的gcd为1,即a,b互质,现在给你一个数m,你知道与它互质的第k个数是多少吗?与m互质的数按 ...

  8. NYOJ 257 中缀表达式表示成后缀表达式

    话说这道题代码那个丑陋啊,,写出来我自己都不想再看第二遍啊...看了看聪神的代码,还消耗我3个NYOJ币啊,,更扯得是,聪神的代码我看不懂啊,,,,卧槽...这道题不再多说了,数据结构上有详细的介绍, ...

  9. 排错-tcpreplay回放错误:send() [218] Message too long (errno = 90)

    排错-tcpreplay回放错误:send() [218] Message too long (errno = 90) by:授客 QQ:1033553122 问题描述: tcpreplay回放.pc ...

最新文章

  1. WebX5 button tabs的bind-text属性设置
  2. java 重定向到某个页面并弹出消息_Java开发面试宝典之网络通信篇
  3. python binary lib on win/各种python库的二进制包
  4. UVA11468 Substring
  5. 实现微信朋友圈动态列表
  6. 抽象类必须要有抽象方法吗?
  7. 使用若依写微信小程序登录授权认证接口
  8. 解决Linux Fedora 虚拟机root用户登录提示鉴定故障的问题
  9. c语言入门 输出图形(1),C语言图形输出习题(1).pdf
  10. 方维o2o系统多通道支付的实现
  11. Android Gmail签名客制化
  12. JavaScript弹性透明的图片放大代码
  13. 1.4 计算机网络的定义和分类
  14. APP测试与WEB测试的区别
  15. LED透明屏多少钱一平方?—实用LED透明屏价格表参考
  16. 动态规划问题——招聘会
  17. 拾色器的四种色彩模型
  18. es使用pinyin搜索,对应中文没有高亮显示
  19. 实用程序完成一些与管理计算机,大学计算机基础模拟试题带答案第二套
  20. linux下使用MEME软件,从零开始学生信-meme的安装和使用

热门文章

  1. 洛必达求极限法则的通俗理解
  2. Chrome浏览器插件(扩展程序)获取以及安装
  3. Attempt to overwrite cell: sheetname=‘Sheet1‘ rowx=1 colx=0问题解决
  4. PHPstudy用Apache的ab工具测试实例详解
  5. mac apache自带 ab 测试工具安装及使用
  6. 【移动终端应用开发】实验1:SharedPreferences的应用
  7. UE4 编辑器内修改贴图分辨率
  8. Tiktok、抖音及头条系为什么能引爆?产品力和算法力「AI产品/工程落地」
  9. DAY01加强版的java自学
  10. 微信小程序开发12 渐进增强:小程序的更新策略