-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathB1081.cpp
More file actions
57 lines (54 loc) · 1.21 KB
/
Copy pathB1081.cpp
File metadata and controls
57 lines (54 loc) · 1.21 KB
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
#include <cstdio>
//#include <cstring>
#include <iostream>
//#include <string>
#include <cctype>
using namespace std;
int main()
{
int n;
scanf("%d", &n);getchar();
for(int i = 0; i < n; i++)
{
string pw;
//scanf("%s", pw);
getline(cin, pw);
int lens = pw.length();
if(lens < 6)
{
printf("Your password is tai duan le.\n");
continue;
}
int flag1 = 0, flag2 = 0;
int flag = 0;
for(int i = 0; i < lens; i++)
{
if((pw[i] <= '9' && pw[i] >= '0') || pw[i] == '.' || (pw[i] <= 'z' && pw[i] >= 'a') || (pw[i] <= 'Z' && pw[i] >= 'A'))
{
if(pw[i] <= '9' && pw[i] >= '0')
flag1 = 1;
else if((pw[i] <= 'z' && pw[i] >= 'a') || (pw[i] <= 'Z' && pw[i] >= 'A'))
flag2 = 1;
}
else
{
printf("Your password is tai luan le.\n");
flag = 1;
break;
}
}
if(flag == 0)
{
if(flag1 == 1 && flag2 == 0){
printf("Your password needs zi mu.\n");
}
else if(flag1 == 0 && flag2 == 1){
printf("Your password needs shu zi.\n");
}
else if(flag1 == 1 && flag2 == 1){
printf("Your password is wan mei.\n");
}
}
}
return 0;
}