zoukankan      html  css  js  c++  java
  • ACM-ICPC 2018 焦作赛区网络预赛 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(1≤T≤100), 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 焦作赛区网络预赛

    题目意思是,给你一个字符串,不区分大小写,如果等于“jessie”,就输出“Good guy!”,反之就输出“Dare you say that again?”

    #include<iostream>
    #include<cstring>
    using namespace std;
    
    int main()
    {
    	char a[100];
    	int n,m,j,k,i,T;
    	cin>>T;
    	getchar();
    	while (T--)
    	{
    		scanf("%s",a);
    	int len=strlen(a);
    	for (i=0;i<len;i++)
    	{
    		if (a[i]>='A'&&a[i]<='Z')
    		a[i] = a[i]-'A'+'a';
    	}
    	if (strcmp(a,"jessie")==0)
    		
    		cout<<"Good guy!"<<endl;
    		else
    		cout<<"Dare you say that again?"<<endl;
    	}
    	
    	
    	return 0;
    }
  • 相关阅读:
    ! JOISC2020DAY2变色龙之恋
    ! JOISC2020DAY1扫除
    JOISC2020DAY1汉堡肉
    JOISC2020DAY1建筑装饰4
    ! JLOI/SHOI2016随机序列
    JLOI/SHOI2016黑暗前的幻想乡
    ! JLOI/SHOI2016成绩比较
    JLOI/SHOI2016方
    JLOI/SHOI2016侦查守卫
    ! AHOI/HNOI2017抛硬币
  • 原文地址:https://www.cnblogs.com/Romantic-Chopin/p/12451421.html
Copyright © 2011-2022 走看看