-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2257.c
54 lines (36 loc) · 1.24 KB
/
2257.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
#include<stdio.h>
#include<string.h>
int main()
{
int j,check,A=0,a=0,N=0,wrong = 1 ,i=10;
char password[50];
while(scanf("%[^\n]%*c",&password)!= EOF){
check = strlen(password);
if (check>5 && check<33){
wrong = 0;
for (j=0;j<check;j++){
if (password[j]>=65 && password[j]<=90){
A=1;
}
else if (password[j]>=97 && password[j]<=122){
a=1;
}
else if (password[j]>=48 && password[j]<=57){
N=1;
}
else {
wrong = 1;
break;
}
}
}
if (A == 1 && a== 1 && N == 1 && wrong == 0 ){
printf("Senha valida.\n");
}
else {
printf("Senha invalida.\n");
}
A = 0, a=0, N = 0, wrong = 1;
}
return 0;
}