zoukankan      html  css  js  c++  java
  • hdoj:2043

    #include <iostream>
    #include <string>
    
    using namespace std;
    
    bool judgeSize(string str)
    {
        int size = str.size();
        if (size < 8 || size>16)
            return false;
        return true;
    }
    
    int isA(string str)
    {
        for (auto &c : str)
        {
            if (c >= 'A' && c <= 'Z')
                return 1;
        }
        return 0;
    }
    int isa(string str)
    {
        for (auto &c : str)
        {
            if (c >= 'a' && c <= 'z')
                return 1;
        }
        return 0;
    }
    int is0(string str)
    {
        for (auto &c : str)
        {
            if (c >= '0' && c <= '9')
                return 1;
        }
        return 0;
    }
    int isOther(string str)
    {
        for (auto &c : str)
        {
            if (c == '~' || c == '!' || c == '@' || c == '#' || c == '$' || c == '%' || c == '^')
                return 1;
    
        }
        return 0;
    }
    int main()
    {
        int M;
        string str;
        while (cin >> M)
        {
            while (M--)
            {
                cin >> str;
                if (judgeSize(str))
                {
                    int judge = isA(str) + isa(str) + is0(str) + isOther(str);
                    if (judge >= 3)
                    {
                        cout << "YES" << endl;
                    }
                    else
                    {
                        cout << "NO" << endl;
                    }
                }
                else
                {
                    cout << "NO" << endl;
                }
            }
        }
    }
  • 相关阅读:
    25 Groovy 相关资料
    24 使用Maven 或 Gradle构建groovy
    UVA
    UVA
    UVA
    UVA
    UVA
    【JZOJ4235】序列【数论,数学】
    【JZOJ4235】序列【数论,数学】
    【JZOJ5230】队伍统计【状压DP】
  • 原文地址:https://www.cnblogs.com/theskulls/p/6005895.html
Copyright © 2011-2022 走看看