include stdio include string int check_password char str int strlen st

 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
#include <stdio.h>
#include <string.h>
int check_password(char *str) {
int N = strlen(str);
int t1 = 0, t2 = 0, t3 = 0;
char ch;
int i;
if (N < 8) {
return 0;
}
for (i = 0; i < N; i++) {
ch = str[i];
if (ch >= '0' && ch <= '9') {
t1 = 1;
}
if (ch >= 'a' && ch <= 'z') {
t2 = 1;
}
if (ch >= 'A' && ch <= 'Z') {
t3 = 1;
}
}
if (t1 && t2 && t3) {
return 1;
}
return 0;
}
int main() {
char str[101];
scanf("%s", (char*)str);
if ( check_password((char*)str) ) {
printf("yes");
} else {
printf("no");
}
return 0;
}