hdu 2043 密码

来源:互联网 发布:淘宝到货多久确认收货 编辑:程序博客网 时间:2024/05/20 09:49
#include<stdio.h>
#include<string.h>
int main()
{
    int M;
    char str[60];
    scanf("%d",&M);
    while(M--)
    {
      int i,a=0,b=0,c=0,d=0,t,len;
      scanf("%s",str);
      len=strlen(str);
     // if(len<8||len>16)
     // {
       // printf("NO\n");
      //  break;
     // }
      for(i=0;i<len;i++)
      {
        if(str[i]>='A'&&str[i]<='Z') a=1;
        if(str[i]>='a'&&str[i]<='z') b=1;
        if(str[i]>='0'&&str[i]<='9') c=1;
        if(str[i]=='~'||str[i]=='!'||str[i]=='@'||str[i]=='#'||str[i]=='$'||str[i]=='%'||str[i]=='^')  d=1;
      }
      t=a+b+c+d;
      if(t>=3&&len>=8&&len<=16) printf("YES\n");
      else  printf("NO\n");
    }
    return 0;
}
0 0
原创粉丝点击