P9459 浴眼盯真 题解

· · 题解

P9459 浴眼盯真 题解

题目分析

这道题很简单,我们先输入 a, b, c, d 四个字符串,如 a_0 = b_0 = \text{y},且 c = \text{ding},d = \text{zhen},就输出 Yes,否则输出 No。

一定记得要输入 T 组数据,我赛时就因为没输入 T 组数据而导致 WA 了 2 次。

code

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define qwq ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
const int N = 1e6 + 10;

namespace ioarray {
    auto read = [](int n, int *a) {
        for (int i = 1; i <= n; ++ i)
            cin >> a[i];
    };
    void print(int n, int *a, string s) {
        for (int i = 1; i <= n; ++ i) {
            cout << a[i];
            cout << s;
        }
        cout << endl;
    }
}
using namespace ioarray;

signed main() {
    int T;
    cin >> T;
    while (T --) {
        string a, b, c, d;
        cin >> a >> b >> c >> d;
        if (a[0] == 'y' && b[0] == 'y' && c == "ding" && d == "zhen") {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    }
    return 0;
}