zoukankan      html  css  js  c++  java
  • 2018ACM/ICPC 焦作网络预选赛-A Magic Mirror

    Jessie has a magic mirror.

    Every morning she will ask the mirror: 'Mirror mirror tell me, who is the most beautiful girl in the world?' If the mirror says her name, she will praise the mirror: 'Good guy!', but if the mirror says the name of another person, she will assail the mirror: 'Dare you say that again?'

    Today Jessie asks the mirror the same question above, and you are given a series of mirror's answers. For each answer, please output Jessie's response. You can assume that the uppercase or lowercase letters appearing anywhere in the name will have no influence on the answer. For example, 'Jessie' and 'jessie' represent the same person.

    Input

    The first line contains an integer T(1 le T le 100)T(1T100), which is the number of test cases.

    Each test case contains one line with a single-word name, which contains only English letters. The length of each name is no more than 1515.

    Output

    For each test case, output one line containing the answer.

    样例输入

    2
    Jessie
    Justin

    样例输出

    Good guy!
    Dare you say that again?

    题目来源

    ACM-ICPC 2018 焦作赛区网络预赛

    签到题:

     1 #include<bits/stdc++.h>
     2 using namespace std;
     3 #define mem(a,b) memset(a,b,sizeof a)
     4 #define eps 1e-8
     5 #define PI acos(-1.0)
     6 typedef long long LL;
     7 typedef pair<int,int> P;
     8 const int INF=0x3f3f3f3f;
     9 int T;
    10 string s; 
    11 
    12 int main()
    13 {
    14     scanf("%d",&T);
    15     while(T--)//Jessie
    16     {
    17         cin>>s;
    18         int len=s.length();
    19         if(len==6)
    20         {
    21             for(int i=0;i<6;i++) if(s[i]>='A'&&s[i]<='Z') s[i]=s[i]+32;
    22             if(s=="jessie") puts("Good guy!");
    23             else puts("Dare you say that again?");
    24         }
    25         else puts("Dare you say that again?");    
    26     }
    27 
    28     return 0;    
    29 } 
    View Code

      

  • 相关阅读:
    关于c语言的一个小bug(c专家编程)
    A10 平板开发一硬件平台搭建
    A10 平板开发二搭建Android开发环境
    hdu
    如何选择发现自己是否适合科研?
    屌丝程序员与房子
    一步一步学数据结构之n--n(Prim算法)
    pat 1049 Counting Ones
    add-strings
    这篇讲PHP的讲的有些道理 & mb_substr & 中文处理
  • 原文地址:https://www.cnblogs.com/csushl/p/9651862.html
Copyright © 2011-2022 走看看