- #include
- #include
-
-
- void main()
- {
- int m, i,len,j,x,y,z,a;
- char s[42];
- while (~scanf_s("%d", &m))
- {
- getchar();
- for (i = 0; i < m; i++)
- {
- fgets(s, sizeof(s), stdin);
- len=strlen(s)-1,a=x=y=z=0;
- if (len < 8 || len>16)printf("NO\n");
- else
- {
- for (j = 0; j < len; j++)
- {
- if (s[j] >= 'A' && s[j] <= 'Z')x = 1;
- else if (s[j] >= 'a' && s[j] <= 'z')y = 1;
- else if (s[j] >= '0' && s[j] <= '9')z = 1;
- else a = 1;//依题,输入的密码只有四种字符类型,前面判断了三种,剩下的只有一组
- }
- if (x + y + z + a >= 3)printf("YES\n");
- else printf("NO\n");
- }
- }
- }
- }