ACM-ICPC 2018 焦作赛区网络预赛 A. Magic Mirror【签到题】

  •  1000ms
  •  65536K

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≤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 15.

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?

解题思路

由于大小写不敏感,因此可以先把输入的字符串变成小写,然后和jessie进行比较,如果相同就输出Good guy! 否则输出 Dare you say that again?

AC的C语言代码

#include<stdio.h>
#include<string.h>

int main()
{
	char s[20];
	int t,i;
	scanf("%d",&t);
	while(t--){
		scanf(" %s",s);
		for(i=0;i<strlen(s);i++)
		  s[i]=tolower(s[i]); 
		if(strcmp(s,"jessie")==0)
		  printf("Good guy!\n");
		else
		  printf("Dare you say that again?\n");
	}
	return 0;
 } 

猜你喜欢

转载自blog.csdn.net/SongBai1997/article/details/82830197