HDU2043 密码

解题思路:10分钟AC,不解释,so easy!

 1 #include<cstdio>
 2 #include<cstring>
 3 #include<algorithm>
 4 using namespace std;
 5 const int maxn = 55;
 6 char str[maxn];
 7 int n;
 8 int main()
 9 {
10     scanf("%d", &n);
11     while(n--)
12     {
13         scanf("%s", str);
14         int len = strlen(str);
15         int cnt = 0;
16         int cnt1, cnt2, cnt3, cnt4;
17         cnt1 = cnt2 = cnt3 = cnt4 = 0;
18         for(int i = 0; i < len; i++)
19         {
20             if(str[i] >= 'a' && str[i] <= 'z') cnt1 = 1;
21             else if(str[i] >= 'A' && str[i] <= 'Z') cnt2 = 1;
22             else if(str[i] >= '0' && str[i] <= '9') cnt3 = 1;
23             else cnt4 = 1;
24         }
25         cnt = cnt1 + cnt2 + cnt3 + cnt4;
26         if(cnt >= 3 && len >=8 && len <= 16) printf("YES\n");
27         else printf("NO\n");
28     }
29     return 0;
30 }
View Code

 

转载于:https://www.cnblogs.com/loveprincess/p/4937914.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值