hdu 2043

来源:互联网 发布:上海税友有哪些软件 编辑:程序博客网 时间:2024/05/16 17:02
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2043
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<string>
#include<algorithm>
#include<stdlib.h>
#include<cmath>
using namespace std;
const int MAX=50;
#define CL(a,b)  memset(a,b,sizeof(a))
#define FOR(i,n) for(int i=0;i<n;i++)
#define FORN(a,b) for(int i=a;i<=b;i++)
#define BIGNUM __int64
//-----------------------我是条纯洁的分界线---------------

int main()
{
    charstr[55];
    intn,len;
    inta,b,c,d;
    boolflag=true;
   cin>>n;
   while(n--)
    {
      a=b=c=d=0;
      cin>>str;
       len=strlen(str);
      FOR(i,len)
       {
         if(str[i]=='!'||str[i]=='^'||str[i]=='~'||str[i]=='@'||str[i]=='#'||str[i]=='$'||str[i]=='%')
             a=1;
          elseif(str[i]>='0'&&str[i]<='9')
             b=1;
         else if(str[i]>='A'&&str[i]<='Z')
               c=1;
         else if(str[i]>='a'&&str[i]<='z')
               d=1;
         else   flag=false;
       }
      if((a+b+c+d>=3)&&flag&&len>=8&&len<=16)
         cout<<"YES\n";
       elsecout<<"NO\n";
    }
    return0;
   
}
0 0