1. 程式人生 > >ACM-ICPC 2018 焦作賽區網路預賽 A. Magic Mirror

ACM-ICPC 2018 焦作賽區網路預賽 A. Magic Mirror

題解

題目大意 忽略大小寫判斷字串是否出現過

直接將字串轉換為全小寫判斷

AC程式碼

#include <stdio.h>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

const int INF = 0x3f3f3f3f;

int main()
{
#ifdef LOCAL
    freopen("C:/input.txt", "r", stdin);
#endif
    int T;
    cin >> T;
    while (T--)
    {
        string
str; cin >> str; for (int i = 0; i < str.size(); i++) str[i] = tolower(str[i]); if (str == "jessie") cout << "Good guy!" << endl; else cout << "Dare you say that again?" << endl; } return 0; }