解题思路:
注意事项:
参考代码:
#include "stdio.h"
#include "string.h"
int main()
{
int n; scanf("%d", &n);
for (int i = 0; i < n; i++)
{
getchar();
char s[100];
int a = 0, b = 0, c = 0, d = 0;
gets(s);
for (int j = 0; s[j] != '\0'; j++)
{
if (s[j] >= 'a' && s[j] <= 'z') { a = 1; }
if (s[j] >= 'A' && s[j] <= 'Z') { b = 1; }
if (s[j] >= '0' && s[j] <= '9') { c = 1; }
if (s[j] == '!' || s[j] == '$'||s[j]=='@'||s[j]=='^'||s[j]=='~'||s[j]=='%' ||s[j]=='#') { d = 1; }
}
if (a + b + c +d>= 3 && strlen(s) >= 8 && strlen(s) <= 16)
{
printf("YES\n");
}
else printf("NO\n");
s[strlen(s)] = '\0';
}
}
0.0分
0 人评分