解题思路:
注意事项:
参考代码:
#include<stdio.h>
#include<string.h>
#include<ctype.h>
int main(){
char a[100];
int n,t,t1,t2,t3,t4,i;//t控制条件一,t1,t2,t3,t4分别控制条件二的四个测试;满足则为1,否则0;
scanf("%d",&n);
getchar();
while(n--){
t = 0; t1 = 0; t2 = 0; t3 = 0; t4 = 0; i = 0;
gets(a);
if(strlen(a)>=8&&strlen(a)<=16) t = 1;
while(a[i]){
if(islower(a[i])) t1 = 1;
if(isupper(a[i])) t2 = 1;
if(a[i]>='0'&&a[i]<='9') t3 = 1;
if(a[i] == '~'||a[i] == '!'||a[i] == '@'||a[i] == '#'||
a[i] == '$'||a[i] == '%'||a[i] == '^') t4 = 1;
++i;
}
if(t1+t2+t3+t4>=3&&t) printf("YES\n");
else printf("NO\n");
}
return 0;
}
0.0分
0 人评分