A. YES or YES?

There is a string ss of length 33, consisting of uppercase and lowercase English letters. Check if it is equal to "YES" (without quotes), where each letter can be in any case. For example, "yES", "Yes", "yes" are all allowable.

Input

The first line of the input contains an integer tt (1≤t≤1031≤t≤103) — the number of testcases.

The description of each test consists of one line containing one string ss consisting of three characters. Each character of ss is either an uppercase or lowercase English letter.

Output

For each test case, output "YES" (without quotes) if ss satisfies the condition, and "NO" (without quotes) otherwise.

You can output "YES" and "NO" in any case (for example, strings "yES", "yes" and "Yes" will be recognized as a positive response).

Examples

InputcopyOutputcopy
10
YES
yES
yes
Yes
YeS
Noo
orZ
yEz
Yas
XES
YES
YES
YES
YES
YES
NO
NO
NO
NO
NO

Note

The first five test cases contain the strings "YES", "yES", "yes", "Yes", "YeS". All of these are equal to "YES", where each character is either uppercase or lowercase.

思路:

将输入的字符串中的字符全部转为小写,判断条件两个:

(1)是否为三个字符,不是直接输出NO

(2)判断是否为yes,是则输出YES,否则输出NO

代码:

#include <iostream>

using namespace std;

int main()
{
    int n;
    cin >>n;

    while(n--)
    {
        string s;
        cin >>s;
        if(s.size() != 3)
        {
            cout <<"NO"<<endl;
            continue;
        }
        for(int i=0;i<s.size();i++)
            if(s[i] >= 'A' && s[i] <= 'Z')
                s[i] += 32;
        int flag = 0;
        if(s[0] == 'y' && s[1] == 'e' && s[2] == 's') cout <<"YES"<<endl;
        else cout <<"NO"<<endl;
    }

    return 0;
}

本题是水体很简单,知道判断条件就可以做出来

GitLab Shell: ... GitLab Shell version >= 14.17.0 ? ... OK (14.17.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Internal API available: FAILED - Internal API unreachable gitlab-shell self-check failed Try fixing it: Make sure GitLab is running; Check the gitlab-shell configuration file: sudo -u git -H editor /opt/gitlab/embedded/service/gitlab-shell/config.yml Please fix the error above and rerun the checks. Checking GitLab Shell ... Finished Checking Gitaly ... Gitaly: ... default ... OK Checking Gitaly ... Finished Checking Sidekiq ... Sidekiq: ... Running? ... no Try fixing it: sudo -u git -H RAILS_ENV=production bin/background_jobs start For more information see: doc/install/installation.md in section "Install Init Script" see log/sidekiq.log for possible errors Please fix the error above and rerun the checks. Checking Sidekiq ... Finished Checking Incoming Email ... Incoming Email: ... Reply by email is disabled in config/gitlab.yml Checking Incoming Email ... Finished Checking LDAP ... LDAP: ... LDAP is disabled in config/gitlab.yml Checking LDAP ... Finished Checking GitLab App ... Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... Exception: could not connect to server: Connection refused Is the server running locally and accepting connections on Unix domain socket "/var/opt/gitlab/postgresql/.s.PGSQL.5432"? GitLab config exists? ... yes GitLab config up to date? ... yes Cable config exists? ... yes Resque config exists? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... skipped (no tmp uploads folder yet) Systemd unit files or init script exist? ... skipped (omnibus-gitlab has neither init script nor systemd units) Systemd unit files or init script up-to-date? ... skipped (omnibus-gitlab has nei
04-01
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值