版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/yz467796454/article/details/82716229
题目链接:https://nanti.jisuanke.com/t/31710
样例输入
2
Jessie
Justin
样例输出
Good guy!
Dare you say that again?
题意:jessie这个人问魔镜谁最美,魔镜说她的名字(不区分大小写),就输出Good guy!否则就输出Dare you say that again?
思路:注意不区分大小写就好了
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<vector>
#include<queue>
#define maxn 300005
using namespace std;
typedef long long ll;
const ll inf=-1e18;
int main(){
int t;
scanf("%d",&t);
while(t--){
char s[20];
scanf("%s",s);
char ans1[]="jessie";
char ans2[]="JESSIE";
int flag=1;
if(strlen(s)!=6)flag=0;
for(int i=0;i<strlen(s);i++){
if(s[i]!=ans1[i]&&s[i]!=ans2[i])flag=0;
}
if(flag)printf("Good guy!\n");
else printf("Dare you say that again?\n");
}
return 0;
}