-
Notifications
You must be signed in to change notification settings - Fork 0
/
42.c
80 lines (78 loc) · 1.23 KB
/
42.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
int Judge(char* str, int sz)
{
int i, count = 0;
int a = 1, b = 1, c = 1, d = 1;
if (sz >= 8 && sz <= 16)
{
for (i = 0; i < sz; i++)
{
if (str[i] == '@' || str[i] == '#' || str[i] == '%' || str[i] == '^' || str[i] == '~'|| str[i] == '!' ||str[i] == '$')
{
if (a > 0)
{
count = count + a;
a--;
}
}
if (str[i] >= '0'&&str[i] <= '9')
{
if (b > 0)
{
count = count + b;
b--;
}
}
if (str[i] >= 'a' && str[i] <= 'z')
{
if (c > 0)
{
count = count + c;
c--;
}
}
if (str[i] >= 'A'&&str[i] <= 'Z')
{
if (d > 0)
{
count = count + d;
d--;
}
}
}
if (count < 3)
return 0;
else
return 1;
}
else
return 0;
}
int main()
{
int input;
scanf("%d", &input);
while ( input )
{
char a;
char str[50] = { 0 };
int i = 0;
getchar();
while ((a = getchar()) != '\n')
{
str[i] = a;
i++;
}
str[i] = '\0';
int sz = (int)strlen(str);
int q = Judge(str, sz);
if (q == 1)
printf("°²È«ÃÜÂ룡\n");
else
printf("ΣÏÕÃÜÂë!\n");
input--;
}
return 0;
}