zoukankan      html  css  js  c++  java
  • NBUT 1217 Dinner 2010辽宁省赛

    Time limit  1000 ms

    Memory limit  32768 kB

    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.

    Input

    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.

    Output

    For each test of the input, output all the name of tableware.

    Sample Input

    3 basketball fork chopsticks
    2 bowl letter

    Sample Output

    fork chopsticks
    bowl

    Hint

    The tableware only contains: bowl, knife, fork and chopsticks.


    签到题
     1 #include<cstdio>
     2 #include<iostream>
     3 #include<string>
     4 #include<cstring>
     5 #include<algorithm>
     6 using namespace std;
     7 
     8 int main()
     9 {
    10     int n;
    11     char a[55];
    12     bool flag;
    13     while(~scanf("%d",&n))
    14     {
    15         flag=false;
    16         while(n--)
    17         {
    18             cin>>a;
    19             if(strcmp(a,"bowl")==0||strcmp(a,"knife")==0||strcmp(a,"fork")==0||strcmp(a,"chopsticks")==0)
    20             {
    21                 if(flag)
    22                     printf(" ");
    23                 cout<<a;
    24                 flag=true;
    25             }
    26         }
    27         cout<<endl;
    28     }
    29     return 0;
    30 }
  • 相关阅读:
    Docker 系列(四):Docker 容器数据卷简单使用
    【QML 动态对象】使用JS中的语句动态创建和销毁组件
    【QML 动态对象】Loader动态加载组件
    vue-cli2.0全局使用sass变量
    两边+居中 布局
    跳转子路由后左侧菜单跳转为空白页,路由地址出错
    el-tree可搜索单选
    el-tree固定高度加滚动条
    前端 权限控制 方式
    综合分析类
  • 原文地址:https://www.cnblogs.com/Annetree/p/6641285.html
Copyright © 2011-2022 走看看