-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1081.c
48 lines (44 loc) · 975 Bytes
/
1081.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
#include<stdio.h>
#include<string.h>
#include<ctype.h>
void prestring(char a[]);
int main()
{
int N;
scanf("%d", &N);
getchar();
for(int i = 0; i < N; i++){
char in[101];
gets(in);
int len = strlen(in);
if(len < 6){
printf("Your password is tai duan le.\n");
continue;
}
prestring(in);
}
return 0;
}
void prestring(char a[]){
int num = 0, alp = 0, i = 0;
while(a[i]){
if(isdigit(a[i])){
num++;
}else if(isalpha(a[i])){
alp++;
}else if(a[i] == '.'){
i = i;
}else{
printf("Your password is tai luan le.\n");
return;
}
i++;
}
if(num == 0){
printf("Your password needs shu zi.\n");
}else if(alp == 0){
printf("Your password needs zi mu.\n");
}else{
printf("Your password is wan mei.\n");
}
}